list fixes: headers, invalid elements, easier ending
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / gutter.js
index a382871..472998a 100644 (file)
@@ -42,12 +42,13 @@ var GutterGroupView = function(gutterView, group) {
     
     this.group.on('viewAdded', this.onViewAdded, this);
     this.group.on('focusToggled', this.onFocusToggled, this);
     
     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);
 };
 $.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('focusToggled', this.onFocusToggled);
+        this.group.off('removed', this.removed);
         this.dom.detach();
     },
     onViewAdded: function(view) {
         this.dom.detach();
     },
     onViewAdded: function(view) {
@@ -79,16 +80,15 @@ $.extend(ViewGroup.prototype, Backbone.Events, {
     getOffsetHint: function() {
         return _.isFunction(this.params.offsetHint) ? this.params.offsetHint() : this.params.offsetHint;
     },
     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);
     addView: function(view) {
         this.views.push(view);
         this.trigger('viewAdded', view);
     },
     show: function() {
         this.gutter.show(this);
+    },
+    remove: function() {
+        this.trigger('removed');
     }
 });
 
     }
 });