1 class Editor.EditorModule.DockModule.ElementBay.Boards extends Backbone.View
\r
3 className: 'boards ui-tabs-vertical ui-helper-clearfix'
\r
5 initialize: (options) ->
\r
7 @parent = options.parent
\r
8 @labels = new Editor.EditorModule.DockModule.ElementBay.Labels({
\r
11 @listenTo(@labels, 'sorted', @sorted)
\r
15 this.$el.append(@labels.render().$el)
\r
18 add_element_tab: (tab) ->
\r
22 this.$el.append(tab.body.$el)
\r
25 # data-z copy to model
\r
28 class Editor.EditorModule.DockModule.ElementBay.Labels extends Backbone.View
\r
31 initialize: (options) ->
\r
33 @parent = options.parent
\r
37 this.$el.addClass('inner-elements-tabs')
\r
38 _.each @zorderd_labels(), (label) =>
\r
39 this.$el.append(label.$el)
\r
42 update: (event, ui) ->
\r
44 $('li', $(@)).map ->
\r
45 $(@).attr('data-z', z)
\r
47 _this.trigger('sorted')
\r
51 zorderd_labels: () ->
\r
53 _.each @bay().tabs, (tab) =>
\r
54 res[tab.label.z()] = tab.label
\r
57 add_label: (label) ->
\r
59 @labels.push(label) # insert array
\r