mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-03 23:44:02 +00:00
Moved tab changed listener into tab control
This commit is contained in:
@@ -17,10 +17,5 @@ define ['marionette', 'vent', 'views/widgets/mixTabHeaderView', 'views/mix/mixLi
|
||||
showMixList: (options)->
|
||||
console.log("Layout: showoing mixlist")
|
||||
@bodyRegion.show(new MixListView(options))
|
||||
@tabChanged(options.order_by)
|
||||
|
||||
tabChanged: (type) ->
|
||||
$('#mix-tab li[id=li-' + type + ']', @el).addClass('active')
|
||||
true
|
||||
|
||||
MixListRegionView
|
||||
@@ -30,13 +30,7 @@
|
||||
|
||||
MixListRegionView.prototype.showMixList = function(options) {
|
||||
console.log("Layout: showoing mixlist");
|
||||
this.bodyRegion.show(new MixListView(options));
|
||||
return this.tabChanged(options.order_by);
|
||||
};
|
||||
|
||||
MixListRegionView.prototype.tabChanged = function(type) {
|
||||
$('#mix-tab li[id=li-' + type + ']', this.el).addClass('active');
|
||||
return true;
|
||||
return this.bodyRegion.show(new MixListView(options));
|
||||
};
|
||||
|
||||
return MixListRegionView;
|
||||
|
||||
@@ -4,4 +4,12 @@ define ['marionette', 'underscore', 'vent', 'text!/tpl/MixTabHeaderView'],
|
||||
class MixTabHeaderView extends Marionette.ItemView
|
||||
template: _.template(Template)
|
||||
|
||||
initialize: ->
|
||||
@listenTo(vent, "mix:showlist", @tabChanged)
|
||||
|
||||
tabChanged: (options) ->
|
||||
$('#mix-tab li[id=li-' + options.order_by + ']', @el).addClass('active')
|
||||
true
|
||||
|
||||
|
||||
MixTabHeaderView
|
||||
@@ -15,6 +15,15 @@
|
||||
|
||||
MixTabHeaderView.prototype.template = _.template(Template);
|
||||
|
||||
MixTabHeaderView.prototype.initialize = function() {
|
||||
return this.listenTo(vent, "mix:showlist", this.tabChanged);
|
||||
};
|
||||
|
||||
MixTabHeaderView.prototype.tabChanged = function(options) {
|
||||
$('#mix-tab li[id=li-' + options.order_by + ']', this.el).addClass('active');
|
||||
return true;
|
||||
};
|
||||
|
||||
return MixTabHeaderView;
|
||||
|
||||
})(Marionette.ItemView);
|
||||
|
||||
Reference in New Issue
Block a user