[#211,view][s]: switch show/hide from events to explicit methods - fixes #211.
This commit is contained in:
@@ -32,12 +32,6 @@ my.Timeline = Backbone.View.extend({
|
||||
this.el = $(this.el);
|
||||
this.timeline = new VMM.Timeline();
|
||||
this._timelineIsInitialized = false;
|
||||
this.bind('view:show', function() {
|
||||
// only call _initTimeline once view in DOM as Timeline uses $ internally to look up element
|
||||
if (self._timelineIsInitialized === false) {
|
||||
self._initTimeline();
|
||||
}
|
||||
});
|
||||
this.model.fields.bind('reset', function() {
|
||||
self._setupTemporalField();
|
||||
});
|
||||
@@ -66,6 +60,13 @@ my.Timeline = Backbone.View.extend({
|
||||
this.el.html(htmls);
|
||||
},
|
||||
|
||||
show: function() {
|
||||
// only call _initTimeline once view in DOM as Timeline uses $ internally to look up element
|
||||
if (this._timelineIsInitialized === false) {
|
||||
this._initTimeline();
|
||||
}
|
||||
},
|
||||
|
||||
_initTimeline: function() {
|
||||
var $timeline = this.el.find(this.elementId);
|
||||
// set width explicitly o/w timeline goes wider that screen for some reason
|
||||
|
||||
Reference in New Issue
Block a user