Moved to module layer, to start not hard coded widgets, to start registured widgets.
This commit is contained in:
parent
6ea8e8e9ea
commit
73cebf8e4a
5 changed files with 14 additions and 23 deletions
|
@ -207,3 +207,4 @@ class App.ChatWidget extends App.Controller
|
|||
)
|
||||
@render()
|
||||
|
||||
App.Config.set( 'chat', App.ChatWidget, 'Widgets' )
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
$ = jQuery.sub()
|
||||
|
||||
class App.Navigation extends App.Controller
|
||||
constructor: ->
|
||||
super
|
||||
|
@ -292,3 +290,5 @@ class App.Navigation extends App.Controller
|
|||
}
|
||||
|
||||
@Config.set( 'NavBarRight', NavBarRight )
|
||||
|
||||
App.Config.set( 'navigation', App.Navigation, 'Widgets' )
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
$ = jQuery.sub()
|
||||
|
||||
class App.Notify extends Spine.Controller
|
||||
events:
|
||||
'click .alert': 'destroy'
|
||||
|
@ -58,3 +56,4 @@ class App.Notify extends Spine.Controller
|
|||
$.noty.closeAll()
|
||||
# $(@el).find('.alert').remove();
|
||||
|
||||
App.Config.set( 'notify', App.Notify, 'Widgets' )
|
||||
|
|
|
@ -13,18 +13,12 @@ class App.Run extends App.Controller
|
|||
# check if session already exists/try to get session data from server
|
||||
App.Auth.loginCheck()
|
||||
|
||||
# start navigation controller
|
||||
new App.Navigation( el: @el.find('#navigation') )
|
||||
|
||||
# start notify controller
|
||||
new App.Notify( el: @el.find('#notify') )
|
||||
|
||||
# start content
|
||||
new App.Content( el: @el.find('#content') )
|
||||
|
||||
# start chat
|
||||
if App.ChatWidget
|
||||
new App.ChatWidget( el: @el.find('#chat') )
|
||||
# start widgets
|
||||
widgets = App.Config.get( 'Widgets' )
|
||||
if widgets
|
||||
for key, widget of widgets
|
||||
@el.append('<div id="' + key + '"></div>')
|
||||
new widget( el: @el.find("##{key}") )
|
||||
|
||||
# bind to fill selected text into
|
||||
App.ClipBoard.bind( @el )
|
||||
|
@ -85,4 +79,6 @@ class App.Content extends App.Controller
|
|||
# @scrollTo( 0, 0, 100 )
|
||||
)
|
||||
|
||||
Spine.Route.setup()
|
||||
Spine.Route.setup()
|
||||
|
||||
App.Config.set( 'content', App.Content, 'Widgets' )
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
|
||||
<div id="app">
|
||||
<div id="navigation"></div>
|
||||
<div id="notify"></div>
|
||||
<div id="content"></div>
|
||||
<div id="chat"></div>
|
||||
</div>
|
||||
<div id="app"></div>
|
||||
|
||||
<div class="container">
|
||||
<footer class="footer">
|
||||
|
|
Loading…
Reference in a new issue