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:
@@ -152,16 +152,17 @@ module.exports = class InventoryController extends BaseController
|
||||
|
||||
# Backbone.View Overrides ######################################################################
|
||||
|
||||
events:
|
||||
'blur input[name="name"]': 'onNameFieldBlur'
|
||||
'blur input[name="quantity"]': 'onQuantityFieldBlur'
|
||||
'click button[name="add"]': 'onAddButtonClicked'
|
||||
'click button[name="clear"]': 'onClearButtonClicked'
|
||||
'focus input[name="name"]': 'onNameFieldFocused'
|
||||
'focus input[name="quantity"]': 'onQuantityFieldFocused'
|
||||
'input input[name="name"]': 'onNameFieldChanged'
|
||||
'input input[name="quantity"]': 'onQuantityFieldChanged'
|
||||
'keyup input[name="name"]': 'onNameFieldKeyUp'
|
||||
events: ->
|
||||
return _.extend super,
|
||||
'blur input[name="name"]': 'onNameFieldBlur'
|
||||
'blur input[name="quantity"]': 'onQuantityFieldBlur'
|
||||
'click button[name="add"]': 'onAddButtonClicked'
|
||||
'click button[name="clear"]': 'onClearButtonClicked'
|
||||
'focus input[name="name"]': 'onNameFieldFocused'
|
||||
'focus input[name="quantity"]': 'onQuantityFieldFocused'
|
||||
'input input[name="name"]': 'onNameFieldChanged'
|
||||
'input input[name="quantity"]': 'onQuantityFieldChanged'
|
||||
'keyup input[name="name"]': 'onNameFieldKeyUp'
|
||||
|
||||
# Private Methods ##############################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user