aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Resizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Resizer.js')
-rwxr-xr-xjs/panels/Resizer.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/panels/Resizer.js b/js/panels/Resizer.js
index 3afe5d5b..e9bd4fc0 100755
--- a/js/panels/Resizer.js
+++ b/js/panels/Resizer.js
@@ -12,6 +12,10 @@ exports.Resizer = Montage.create(Component, {
12 hasTemplate: { 12 hasTemplate: {
13 value: false 13 value: false
14 }, 14 },
15
16 ownerId: {
17 value: ""
18 },
15 19
16 _isInversed: { 20 _isInversed: {
17 value: false 21 value: false
@@ -74,7 +78,6 @@ exports.Resizer = Montage.create(Component, {
74 e.preventDefault(); 78 e.preventDefault();
75 this.panel.addEventListener("webkitTransitionEnd", this, true); 79 this.panel.addEventListener("webkitTransitionEnd", this, true);
76 if (this.isVertical) { 80 if (this.isVertical) {
77 //console.log("y: " + e.y + " startPosition: " + this._startPosition + " initDimension: " + this._initDimension);
78 this._startPosition = e.y; 81 this._startPosition = e.y;
79 this._initDimension = this.panel.offsetHeight; 82 this._initDimension = this.panel.offsetHeight;
80 } 83 }
@@ -98,7 +101,7 @@ exports.Resizer = Montage.create(Component, {
98 } else { 101 } else {
99 this.panel.style.width = ""; 102 this.panel.style.width = "";
100 } 103 }
101 this.application.ninja.settings.setSetting(this.element.id,"value", ""); 104// this.application.ninja.settings.setSetting(this.element.id,"value", "");
102 } 105 }
103 }, 106 },
104 107
@@ -113,6 +116,8 @@ exports.Resizer = Montage.create(Component, {
113 116
114 prepareForDraw: { 117 prepareForDraw: {
115 value: function() { 118 value: function() {
119// console.log("owner id: ", this.ownerId);
120 console.log("resizer for ", this.element.getAttribute("data-montage-id") + this.ownerId);
116 if(this.value != null) { 121 if(this.value != null) {
117 if (this.isVertical) { 122 if (this.isVertical) {
118 this.panel.style.height = this.value + "px"; 123 this.panel.style.height = this.value + "px";
@@ -142,7 +147,7 @@ exports.Resizer = Montage.create(Component, {
142 } else { 147 } else {
143 this.panel.style.width = this.panel.offsetWidth; 148 this.panel.style.width = this.panel.offsetWidth;
144 } 149 }
145 this.application.ninja.settings.setSetting(this.element.id,"value", this.value); 150// this.application.ninja.settings.setSetting(this.element.id,"value", this.value);
146 if(this.redrawStage) { 151 if(this.redrawStage) {
147 this.application.ninja.stage.resizeCanvases = true; 152 this.application.ninja.stage.resizeCanvases = true;
148 } 153 }
@@ -154,7 +159,6 @@ exports.Resizer = Montage.create(Component, {
154 value: function(e) { 159 value: function(e) {
155 if(this.isVertical) { 160 if(this.isVertical) {
156 this.value = this._isInversed ? this._initDimension + (this._startPosition - e.y) : this._initDimension + (e.y - this._startPosition); 161 this.value = this._isInversed ? this._initDimension + (this._startPosition - e.y) : this._initDimension + (e.y - this._startPosition);
157 //console.log("y: " + e.y + " startPosition: " + this._startPosition + " initDimension: " + this._initDimension + " finalPosition: " + pos);
158 this.panel.style.height = this.value + "px"; 162 this.panel.style.height = this.value + "px";
159 } 163 }
160 else { 164 else {
@@ -184,12 +188,14 @@ exports.Resizer = Montage.create(Component, {
184 188
185 value: { 189 value: {
186 get: function() { 190 get: function() {
191 /*
187 if(this.application.ninja.settings) { 192 if(this.application.ninja.settings) {
188 var gottenValue = this.application.ninja.settings.getSetting(this.id, "value"); 193 var gottenValue = this.application.ninja.settings.getSetting(this.id, "value");
189 if (this._value == null && gottenValue !=null) { 194 if (this._value == null && gottenValue !=null) {
190 this.value = gottenValue; 195 this.value = gottenValue;
191 } 196 }
192 } 197 }
198 */
193 return this._value; 199 return this._value;
194 }, 200 },
195 set: function(val) { 201 set: function(val) {