Author: dmorozov
Date: 2007-06-13 11:19:25 -0400 (Wed, 13 Jun 2007)
New Revision: 1157
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/LayoutManager.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/VLayoutManager.js
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/LayoutManager.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/LayoutManager.js 2007-06-13
15:17:34 UTC (rev 1156)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/LayoutManager.js 2007-06-13
15:19:25 UTC (rev 1157)
@@ -15,7 +15,17 @@
CLASSDEF: {
name: 'ClientUI.layouts.LayoutManager',
parent: ClientUI.common.box.Box
- }
+ },
+
+ // Custom events
+ /**
+ * Occured before resizing
+ */
+ eventOnBeforeResize: {},
+ /**
+ * Occured after resizing
+ */
+ eventOnAfterResize: {}
});
@@ -31,6 +41,10 @@
// declare event listeners
this.eventContainerResize = this.containerResize.bindAsEventListener(this);
+ // Create custom event producers
+ this.eventOnBeforeResize = new
ClientUI.common.utils.CustomEvent('OnBeforeResize');
+ this.eventOnAfterResize = new
ClientUI.common.utils.CustomEvent('OnAfterResize');
+
this.registerEvents();
},
registerEvents: function() {
@@ -43,13 +57,20 @@
},
containerResize: function(event) {
//Event.stop(event);
- // TODO:
+ this.eventOnBeforeResize.fire();
this.updateLayout();
+ this.eventOnAfterResize.fire();
},
updateLayout: function() {
if(this.container) {
- this.setWidth(this.container.getWidth());
- this.setHeight(this.container.getHeight());
+ var w = this.container.getWidth();
+ var h = this.container.getWidth();
+ if(ClientUILib.isGecko) {
+ w -= this.container.getBorderWidth("lr") +
this.container.getPadding("lr");
+ h -= this.container.getBorderWidth("tb") +
this.container.getPadding("tb");
+ }
+ this.setWidth(w);
+ this.setHeight(h);
}
ClientUI.layouts.LayoutManager.parentClass.method("updateLayout").call(this);
},
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/VLayoutManager.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/VLayoutManager.js 2007-06-13
15:17:34 UTC (rev 1156)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/layouts/VLayoutManager.js 2007-06-13
15:19:25 UTC (rev 1157)
@@ -63,6 +63,10 @@
var parentBox = this.getContainer();
var height = parentBox.getViewportHeight();
var width = parentBox.getViewportWidth();
+ if(ClientUILib.isGecko) {
+ width -= parentBox.getBorderWidth("lr") +
parentBox.getPadding("lr");
+ height -= parentBox.getBorderWidth("tb") +
parentBox.getPadding("tb");
+ }
// NOTE: not implemented in this class
if(this.panels) {
Show replies by date