Roo/bootstrap/layout/East.js
authorAlan Knowles <alan@roojs.com>
Fri, 7 Dec 2018 06:41:45 +0000 (14:41 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Dec 2018 06:41:45 +0000 (14:41 +0800)
Roo/bootstrap/layout/East.js [new file with mode: 0644]

diff --git a/Roo/bootstrap/layout/East.js b/Roo/bootstrap/layout/East.js
new file mode 100644 (file)
index 0000000..dadf044
--- /dev/null
@@ -0,0 +1,45 @@
+
+Roo.bootstrap.layout.East = function(config){
+    config.region = "east";
+    config.cursor = "e-resize";
+    Roo.bootstrap.layout.Split.call(this, config);
+    if(this.split){
+        this.split.placement = Roo.bootstrap.SplitBar.RIGHT;
+        this.split.orientation = Roo.bootstrap.SplitBar.HORIZONTAL;
+        this.split.el.addClass("roo-layout-split-h");
+    }
+    var size = config.initialSize || config.width;
+    if(typeof size != "undefined"){
+        this.el.setWidth(size);
+    }
+};
+Roo.extend(Roo.bootstrap.layout.East, Roo.bootstrap.layout.Split, {
+    orientation: Roo.bootstrap.SplitBar.HORIZONTAL,
+    getBox : function(){
+        if(this.collapsed){
+            return this.collapsedEl.getBox();
+        }
+        var box = this.el.getBox();
+        if(this.split){
+            var sw = this.split.el.getWidth();
+            box.width += sw;
+            box.x -= sw;
+        }
+        return box;
+    },
+
+    updateBox : function(box){
+        if(this.split && !this.collapsed){
+            var sw = this.split.el.getWidth();
+            box.width -= sw;
+            this.split.el.setLeft(box.x);
+            this.split.el.setTop(box.y);
+            this.split.el.setHeight(box.height);
+            box.x += sw;
+        }
+        if(this.collapsed){
+            this.updateBody(null, box.height);
+        }
+        Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
+    }
+});