gutterBoxTemplate = require('libs/text!./gutterBox.html');
-var GutterView = function(gutter) {
+var GutterView = function(gutter, tutorial) {
gutter.on('show', function(group) {
if(this.groupView) {
this.groupView.remove();
this.groupView.show();
}, this);
this.dom = $('<div class="gutter"></div>');
+ var tutorialHolder = $('<div/>').attr('data-toggle', 'tutorial').attr('data-tutorial', tutorial.index)
+ .attr('data-placement', 'bottom').attr('data-content', tutorial.text);
+ this.dom.append(tutorialHolder);
};
this.group.on('viewAdded', this.onViewAdded, this);
this.group.on('focusToggled', this.onFocusToggled, this);
+ this.group.on('removed', this.remove, this);
};
$.extend(GutterGroupView.prototype, {
remove: function() {
this.group.off('viewAdded', this.onViewAdded);
this.group.off('focusToggled', this.onFocusToggled);
+ this.group.off('removed', this.removed);
this.dom.detach();
},
onViewAdded: function(view) {
},
show: function() {
this.gutter.show(this);
+ },
+ remove: function() {
+ this.trigger('removed');
}
});