Browse Source

pjax failing in production ...

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
9d4354bde6
  1. 26
      app/assets/javascripts/application.js.coffee

26
app/assets/javascripts/application.js.coffee

@ -7,8 +7,8 @@
#= require jquery
#= require jquery-ui
#= require jquery_ujs
#= require jquery.pjax
#= require pjax/page_triggers
## require jquery.pjax
## require pjax/page_triggers
#= require slides
#= require bootstrap
#= require active_scaffold
@ -18,14 +18,14 @@ $ ->
$(document).popover(selector: '[rel=popover]')
$(document).tooltip(selector: '[rel=tooltip]')
pjaxContainer = '[data-pjax-container]'
$('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax(pjaxContainer)
$pjaxContainer = $(pjaxContainer)
$pjaxContainerParent = $(pjaxContainer).parent()
$pjaxContainer.on 'pjax:success', (event, data, status, xhr, options) ->
$('.pjax-nav').find('li.active').removeClass 'active'
$(".pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active'
if $pjaxContainer.find('.container').length > 0
$pjaxContainerParent.removeClass 'container'
else
$pjaxContainerParent.addClass 'container'
# pjaxContainer = '[data-pjax-container]'
# $('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax(pjaxContainer)
# $pjaxContainer = $(pjaxContainer)
# $pjaxContainerParent = $(pjaxContainer).parent()
# $pjaxContainer.on 'pjax:success', (event, data, status, xhr, options) ->
# $('.pjax-nav').find('li.active').removeClass 'active'
# $(".pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active'
# if $pjaxContainer.find('.container').length > 0
# $pjaxContainerParent.removeClass 'container'
# else
# $pjaxContainerParent.addClass 'container'

Loading…
Cancel
Save