From 97f21076db2603a1437f8bade3d9713433d473fe Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 23 Apr 2012 11:49:06 -0700 Subject: CSS Panel - Add stub for resizer --- js/panels/css-panel/css-panel.reel/css-panel.js | 37 ++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'js/panels/css-panel/css-panel.reel/css-panel.js') diff --git a/js/panels/css-panel/css-panel.reel/css-panel.js b/js/panels/css-panel/css-panel.reel/css-panel.js index 228e91f6..21a466d5 100644 --- a/js/panels/css-panel/css-panel.reel/css-panel.js +++ b/js/panels/css-panel/css-panel.reel/css-panel.js @@ -8,11 +8,28 @@ var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; exports.CSSPanelNew = Montage.create(Component, { - templateDidLoad : { - value: function() { - console.log("css panel : template did load"); + _resizedHeight : { + value: null + }, + isResizing : { + value: null + }, + _height: { + value: null + }, + height: { + get: function() { + return this._height; + }, + set: function(val) { + if(this._height !== val) { + this._height = val; + this.needsDraw = true; + } } }, + + prepareForDraw : { value: function() { console.log("css panel : prepare for draw"); @@ -20,7 +37,19 @@ exports.CSSPanelNew = Montage.create(Component, { }, draw : { value: function() { - console.log("css panel : draw"); + console.log("css panel : draw. height: ", this.height); + +// if(this.height) { +// console.log("CSS Panel draw - resizing to", (this.height + this._resizedHeight) + "px"); +// this.styleSheetsView.element.style.height = (this.height + this._resizedHeight) + "px"; +// } + } + }, + didDraw: { + value: function() { + if(!this.isResizing) { + //this.height = this.element.offsetHeight; + } } } }); -- cgit v1.2.3