remove mismatched html tags
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / gutter.js
index a382871..00b118e 100644 (file)
@@ -8,7 +8,7 @@ var $ = require('libs/jquery'),
     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();
@@ -19,6 +19,9 @@ var GutterView = function(gutter) {
         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', 'left').attr('data-content', tutorial.text).css('height', '200px');
+    this.dom.append($('<div>/').css('height', '0').append(tutorialHolder));
 };
 
 
@@ -42,12 +45,13 @@ var GutterGroupView = function(gutterView, group) {
     
     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('offsetChange', this.onOffsetChange);
         this.group.off('focusToggled', this.onFocusToggled);
+        this.group.off('removed', this.removed);
         this.dom.detach();
     },
     onViewAdded: function(view) {
@@ -79,16 +83,15 @@ $.extend(ViewGroup.prototype, Backbone.Events, {
     getOffsetHint: function() {
         return _.isFunction(this.params.offsetHint) ? this.params.offsetHint() : this.params.offsetHint;
     },
-    setOffset: function(offset) {
-        this.trigger('offsetChange', offset);
-        this._offset = offset;
-    },
     addView: function(view) {
         this.views.push(view);
         this.trigger('viewAdded', view);
     },
     show: function() {
         this.gutter.show(this);
+    },
+    remove: function() {
+        this.trigger('removed');
     }
 });