Code cleanup.
This commit is contained in:
parent
a21fa42762
commit
78cceb4685
2 changed files with 5 additions and 5 deletions
|
@ -41,6 +41,9 @@ class App.Controller extends Spine.Controller
|
||||||
window.history.replaceState(null, null, oldLocation)
|
window.history.replaceState(null, null, oldLocation)
|
||||||
super location
|
super location
|
||||||
|
|
||||||
|
preventDefault: (e) ->
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
bind: (event, callback) =>
|
bind: (event, callback) =>
|
||||||
App.Event.bind(
|
App.Event.bind(
|
||||||
event
|
event
|
||||||
|
|
|
@ -10,7 +10,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
|
||||||
'click .js-toggleNotifications': 'toggleNotifications'
|
'click .js-toggleNotifications': 'toggleNotifications'
|
||||||
'click .js-emptySearch': 'emptyAndClose'
|
'click .js-emptySearch': 'emptyAndClose'
|
||||||
'dblclick .search-holder .icon-magnifier': 'openExtendedSearch'
|
'dblclick .search-holder .icon-magnifier': 'openExtendedSearch'
|
||||||
'submit form.search-holder': 'ignore'
|
'submit form.search-holder': 'preventDefault'
|
||||||
'focus #global-search': 'searchFocus'
|
'focus #global-search': 'searchFocus'
|
||||||
'blur #global-search': 'searchBlur'
|
'blur #global-search': 'searchBlur'
|
||||||
'keydown #global-search': 'listNavigate'
|
'keydown #global-search': 'listNavigate'
|
||||||
|
@ -191,9 +191,6 @@ class App.Navigation extends App.ControllerWidgetPermanent
|
||||||
@notificationWidget = new App.OnlineNotificationWidget()
|
@notificationWidget = new App.OnlineNotificationWidget()
|
||||||
$('#app').append @notificationWidget.el
|
$('#app').append @notificationWidget.el
|
||||||
|
|
||||||
ignore: (e) ->
|
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
searchFocus: (e) =>
|
searchFocus: (e) =>
|
||||||
@query = '' # reset query cache
|
@query = '' # reset query cache
|
||||||
@searchContainer.addClass('focused')
|
@searchContainer.addClass('focused')
|
||||||
|
@ -322,7 +319,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
|
||||||
|
|
||||||
@renderResult(result)
|
@renderResult(result)
|
||||||
)
|
)
|
||||||
@delay(search, 200, 'search')
|
@delay(search, delay, 'search')
|
||||||
|
|
||||||
getItems: (data) ->
|
getItems: (data) ->
|
||||||
navbar = _.values(data.navbar)
|
navbar = _.values(data.navbar)
|
||||||
|
|
Loading…
Reference in a new issue