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()
|
@render()
|
||||||
|
|
||||||
|
App.Config.set( 'chat', App.ChatWidget, 'Widgets' )
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
$ = jQuery.sub()
|
|
||||||
|
|
||||||
class App.Navigation extends App.Controller
|
class App.Navigation extends App.Controller
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
@ -292,3 +290,5 @@ class App.Navigation extends App.Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
@Config.set( 'NavBarRight', NavBarRight )
|
@Config.set( 'NavBarRight', NavBarRight )
|
||||||
|
|
||||||
|
App.Config.set( 'navigation', App.Navigation, 'Widgets' )
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
$ = jQuery.sub()
|
|
||||||
|
|
||||||
class App.Notify extends Spine.Controller
|
class App.Notify extends Spine.Controller
|
||||||
events:
|
events:
|
||||||
'click .alert': 'destroy'
|
'click .alert': 'destroy'
|
||||||
|
@ -58,3 +56,4 @@ class App.Notify extends Spine.Controller
|
||||||
$.noty.closeAll()
|
$.noty.closeAll()
|
||||||
# $(@el).find('.alert').remove();
|
# $(@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
|
# check if session already exists/try to get session data from server
|
||||||
App.Auth.loginCheck()
|
App.Auth.loginCheck()
|
||||||
|
|
||||||
# start navigation controller
|
# start widgets
|
||||||
new App.Navigation( el: @el.find('#navigation') )
|
widgets = App.Config.get( 'Widgets' )
|
||||||
|
if widgets
|
||||||
# start notify controller
|
for key, widget of widgets
|
||||||
new App.Notify( el: @el.find('#notify') )
|
@el.append('<div id="' + key + '"></div>')
|
||||||
|
new widget( el: @el.find("##{key}") )
|
||||||
# start content
|
|
||||||
new App.Content( el: @el.find('#content') )
|
|
||||||
|
|
||||||
# start chat
|
|
||||||
if App.ChatWidget
|
|
||||||
new App.ChatWidget( el: @el.find('#chat') )
|
|
||||||
|
|
||||||
# bind to fill selected text into
|
# bind to fill selected text into
|
||||||
App.ClipBoard.bind( @el )
|
App.ClipBoard.bind( @el )
|
||||||
|
@ -85,4 +79,6 @@ class App.Content extends App.Controller
|
||||||
# @scrollTo( 0, 0, 100 )
|
# @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="app"></div>
|
||||||
<div id="navigation"></div>
|
|
||||||
<div id="notify"></div>
|
|
||||||
<div id="content"></div>
|
|
||||||
<div id="chat"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
|
|
Loading…
Reference in a new issue