Fix bugs in intra-site linking
* Refactor event handling in controllers to use a method to define the hash (and thereby allow inheritance) * Refactor link handling so that links which should be handled by the router can be handled by the base class * Change the router to throw out controllers for pages which aren't on-screen (and thereby avoid a lot of weirdness)
This commit is contained in:
@@ -26,10 +26,6 @@ module.exports = class ModController extends BaseController
|
||||
|
||||
# Event Methods ################################################################################
|
||||
|
||||
onNameClicked: (event)->
|
||||
router.navigate @$nameLink.attr('href'), trigger:true
|
||||
return false
|
||||
|
||||
onVersionChanged: ->
|
||||
@model.activeVersion = @$version.val()
|
||||
@_plan.removeUncraftableItems()
|
||||
@@ -71,6 +67,7 @@ module.exports = class ModController extends BaseController
|
||||
|
||||
# Backbone.View Overrides ######################################################################
|
||||
|
||||
events:
|
||||
'change .version': 'onVersionChanged'
|
||||
'click .name a': 'onNameClicked'
|
||||
events: ->
|
||||
return _.extend super,
|
||||
'change .version': 'onVersionChanged'
|
||||
'click a': 'routeLinkClick'
|
||||
|
||||
Reference in New Issue
Block a user