client/lanes/workspace/ScreensMenu.coffee in lanes-0.1.2 vs client/lanes/workspace/ScreensMenu.coffee in lanes-0.1.5
- old
+ new
@@ -3,12 +3,11 @@
template: "<li><a href='#'><span></span><i></i></a></li>"
FILE: FILE
mixins:[
Lanes.Workspace.WorkspaceView
]
-
- events:
+ domEvents:
click: 'displayScreen'
displayScreen: ->
this.model.display(this.viewport)
@@ -17,17 +16,17 @@
'model.icon': { selector: 'i', type: 'class' }
class ScreenGroup extends Lanes.Views.Base
- template: -> '<li class="group"><a href="#"><span></span><i></i></a><ul></ul></li>'
+ template: '<li class="group"><a class="heading" href="#"><span></span><i></i></a><ul></ul></li>'
FILE: FILE
mixins:[
Lanes.Workspace.WorkspaceView
]
- events:
- 'click .group>a': 'toggleMenu'
+ domEvents:
+ 'click a.heading': 'toggleMenu'
initialize: ->
this.screens = @model.screens()
subviews:
@@ -44,47 +43,39 @@
toggleMenu: (ev)->
ev.preventDefault()
@model.active = ! @model.active
-
-
class Lanes.Workspace.ScreensMenu extends Lanes.Views.Base
+ FILE: FILE
templateName: 'screens-menu'
mixins:[
Lanes.Workspace.WorkspaceView
]
-
- FILE: FILE
-
subviews:
navigation:
container: 'ul.navigation'
collection: 'groups'
view: ScreenGroup
-
- events:
+ domEvents:
'highlight-hide': 'onHighlightHide'
'highlight-show': 'onHighlightShown'
'click .logout': 'onLogout'
-
session:
groups: 'collection'
-
- key_scope: { name: 'menu', shortcut: 'ctrl+shift+m' }
- key_bindings:
+ keyScope: { name: 'menu', shortcut: 'ctrl+shift+m' }
+ keyBindings:
up: 'prevMenu'
down: 'nextMenu'
enter: 'onEnter'
right: 'expandMenu'
left: 'collapseMenu'
-
initialize: ->
super
this.listenTo(Lanes.current_user, "change:isLoggedIn", this.resetGroups)
- @groups = Lanes.Models.Screens.groups.available()
+ @groups = Lanes.Screens.Definitions.groups.available()
this
resetGroups: ->
@groups.filter()