Add dblclick handler to vertical splitbar
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 26 Nov 2009 00:07:50 +0000 (17:07 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Nov 2009 01:30:27 +0000 (18:30 -0700)
imp/js/ViewPort.js

index 662d6e8..9b33153 100644 (file)
@@ -950,7 +950,7 @@ var ViewPort = Class.create({
         case 'default':
             return (this.pane_mode == 'vert')
                 ? this.getPageSize('max')
-                : Math.max(parseInt(this.getPageSize('max') * 0.45), 5);
+                : Math.max(parseInt(this.getPageSize('max') * 0.45, 10), 5);
 
         case 'max':
         case 'splitmax':
@@ -1081,6 +1081,13 @@ var ViewPort = Class.create({
                     }
                 }.bind(this)
             });
+
+            sp.currbar.observe('dblclick', function() {
+                this.opts.content.setStyle({ width: parseInt(this.opts.container.clientWidth * 0.45, 10) + 'px' });
+                if (this.opts.onSplitBarChange) {
+                    this.opts.onSplitBarChange('vert');
+                }
+            }.bind(this));
             break;
         }
     },