Bug #8995: need to clear all existing DIVs when switching pane modes
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Apr 2010 17:24:20 +0000 (11:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Apr 2010 17:24:20 +0000 (11:24 -0600)
imp/js/ViewPort.js

index 94fd269..c36b949 100644 (file)
@@ -473,6 +473,7 @@ var ViewPort = Class.create({
     {
         var h,
             c = this.opts.content,
+            c_opts = {},
             lh = this._getLineHeight(),
             sp = this.split_pane;
 
@@ -480,6 +481,10 @@ var ViewPort = Class.create({
             this.page_size = size;
         }
 
+        if (this.view && sp.curr != this.pane_mode) {
+            c_opts.updated = this.createSelection('div', this.visibleRows()).get('domid');
+        }
+
         // Get split pane dimensions
         switch (this.pane_mode) {
         case 'horiz':
@@ -548,14 +553,15 @@ var ViewPort = Class.create({
         }
 
         if (this.view) {
-            this.requestContentRefresh(this.currentOffset());
+            this.requestContentRefresh(this.currentOffset(), c_opts);
         }
     },
 
     // offset = (integer) TODO
-    requestContentRefresh: function(offset)
+    // opts = (object) See _updateContent()
+    requestContentRefresh: function(offset, opts)
     {
-        if (!this._updateContent(offset)) {
+        if (!this._updateContent(offset, opts)) {
             return false;
         }
 
@@ -1248,7 +1254,9 @@ var ViewPort = Class.create({
     createSelection: function(format, data, view)
     {
         var buffer = this._getBuffer(view);
-        return buffer ? new ViewPort_Selection(buffer, format, data) : new ViewPort_Selection(this._getBuffer(this.view));
+        return buffer
+            ? new ViewPort_Selection(buffer, format, data)
+            : new ViewPort_Selection(this._getBuffer(this.view));
     },
 
     getSelection: function(view)