lib/assets/javascripts/up/navigation.js.coffee in upjs-rails-0.11.1 vs lib/assets/javascripts/up/navigation.js.coffee in upjs-rails-0.12.0
- old
+ new
@@ -9,20 +9,20 @@
This dramatically improves the perceived speed of your user interface
by providing instant feedback for user interactions.
@class up.navigation
###
-up.navigation = (->
+up.navigation = (($) ->
u = up.util
###*
Sets default options for this module.
- @method up.navigation.defaults
- @param {Number} [options.currentClass]
- The class to set on [links that point the current location](#up-current).
+ @method up.navigation.config
+ @param {Number} [config.currentClasses]
+ An array of classes to set on [links that point the current location](#up-current).
###
config = u.config
currentClasses: ['up-current']
reset = ->
@@ -187,29 +187,30 @@
<a href="/reports" up-alias="/reports/*">Reports</a>
@method [up-current]
@ujs
###
- up.bus.on 'fragment:ready', ->
+ up.on 'up:fragment:inserted', ->
# If a new fragment is inserted, it's likely to be the result
# of the active action. So we can remove the active marker.
unmarkActive()
- # When a fragment is ready it might either have brought a location change
+ # When a fragment is inserted it might either have brought a location change
# with it, or it might have opened a modal / popup which we consider
# to be secondary location sources (the primary being the browser's
# location bar).
locationChanged()
- up.bus.on 'fragment:destroy', ($fragment) ->
+ up.on 'up:fragment:destroy', (event, $fragment) ->
# If the destroyed fragment is a modal or popup container
# this changes which URLs we consider currents.
# Also modals and popups restore their previous history
# once they close.
if $fragment.is('.up-modal, .up-popup')
locationChanged()
# The framework is reset between tests
- up.bus.on 'framework:reset', reset
+ up.on 'up:framework:reset', reset
- defaults: config.update
+ config: config
+ defaults: -> u.error('up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.')
-)()
+)(jQuery)