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:
@@ -20,12 +20,6 @@ module.exports = class ItemController extends BaseController
|
||||
|
||||
@_modPack = options.modPack
|
||||
|
||||
# Event Methods ################################################################################
|
||||
|
||||
onLinkClicked: ->
|
||||
router.navigate @$nameLink.attr('href'), trigger:true
|
||||
return false
|
||||
|
||||
# BaseController Overrides #####################################################################
|
||||
|
||||
onDidRender: ->
|
||||
@@ -43,5 +37,6 @@ module.exports = class ItemController extends BaseController
|
||||
|
||||
# Backbone.View Overrides ######################################################################
|
||||
|
||||
events:
|
||||
'click a': 'onLinkClicked'
|
||||
events: ->
|
||||
return _.extend super,
|
||||
'click a': 'routeLinkClick'
|
||||
|
||||
Reference in New Issue
Block a user