forked from EvanPeelle/Adviz.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
466fc18
commit f77fa76
Showing
4 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,41 @@ | ||
var TabsView = Backbone.View.extend({ | ||
initialize: function(){ | ||
this.model.on('change:activeTab', function(){ | ||
this.render(); | ||
},this) | ||
this.render(); | ||
}, | ||
events: { | ||
'click a': 'parseClick' | ||
}, | ||
template: _.template('<ul class="nav nav-tabs">' + | ||
'<li><a id="bubble-tab">Bubble Chart</a></li>' + | ||
'<li><a id="graph2-tab">Graph2</a></li>' + | ||
'<li><a id="graph3-tab">Graph3</a></li>' + | ||
'<li><a id="graph4-tab">Graph4</a></li>' + | ||
'</ul>' | ||
), | ||
|
||
parseClick: function(event){ | ||
this.model.set('activeTab', event.target.id); | ||
}, | ||
|
||
render: function(){ | ||
this.$el.empty(); | ||
this.$el.append(this.template()); | ||
this.$el.find('#'+ this.model.get('activeTab')).parent().attr('class', 'active'); | ||
} | ||
|
||
}); | ||
|
||
TabView | ||
id: this.model.get('viewId'), | ||
var TabView = Backbone.View.extend({ | ||
initialize: function(){ | ||
}, | ||
|
||
template: _.template('<div id='graph'></div><div id='table'></div>'), | ||
template: _.template("<div id='graph'></div><div id='table'></div>"), | ||
|
||
render: functin(){ | ||
render: function(){ | ||
this.$el.append(svc); | ||
this.$el.append(table); | ||
} | ||
} | ||
}); |