aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/lib/rdge/materials/cloud-material.js4
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.css9
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.js24
-rw-r--r--js/tools/BrushTool.js1
-rwxr-xr-xjs/tools/LineTool.js1
-rwxr-xr-xjs/tools/PenTool.js1
-rwxr-xr-xjs/tools/ShapeTool.js3
7 files changed, 34 insertions, 9 deletions
diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js
index 748e26dd..11372d12 100644
--- a/js/lib/rdge/materials/cloud-material.js
+++ b/js/lib/rdge/materials/cloud-material.js
@@ -34,7 +34,6 @@ var Material = require("js/lib/rdge/materials/material").Material;
34var GLWorld = require("js/lib/drawing/world").World; 34var GLWorld = require("js/lib/drawing/world").World;
35var Texture = require("js/lib/rdge/texture").Texture; 35var Texture = require("js/lib/rdge/texture").Texture;
36var ElementMediator = require("js/mediators/element-mediator").ElementMediator; 36var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
37var TagTool = require("js/tools/TagTool").TagTool;
38 37
39/////////////////////////////////////////////////////////////////////// 38///////////////////////////////////////////////////////////////////////
40// Class GLMaterial 39// Class GLMaterial
@@ -152,8 +151,7 @@ var CloudMaterial = function CloudMaterial()
152 151
153 ////////////////////////////////////////////////////////////////////////////////// 152 //////////////////////////////////////////////////////////////////////////////////
154 // IS THIS NECESSARY?? 153 // IS THIS NECESSARY??
155// var elementModel = TagTool.makeElement(~~srcCanvas.width, ~~srcCanvas.height, 154// var elementModel = TagTool.makeElement(~~srcCanvas.width, ~~srcCanvas.height, Matrix.I(4), [0,0,0], srcCanvas);
156// Matrix.I(4), [0,0,0], srcCanvas);
157// ElementMediator.addElement(srcCanvas, elementModel.data, true); 155// ElementMediator.addElement(srcCanvas, elementModel.data, true);
158 ////////////////////////////////////////////////////////////////////////////////// 156 //////////////////////////////////////////////////////////////////////////////////
159 157
diff --git a/js/panels/css-panel/css-style.reel/css-style.css b/js/panels/css-panel/css-style.reel/css-style.css
index d6ca76d1..928c2a33 100644
--- a/js/panels/css-panel/css-style.reel/css-style.css
+++ b/js/panels/css-panel/css-style.reel/css-style.css
@@ -138,6 +138,15 @@ POSSIBILITY OF SUCH DAMAGE.
138.style-item .hintable-hint { 138.style-item .hintable-hint {
139 color: #bdbdbd; 139 color: #bdbdbd;
140} 140}
141.edit-value {
142 white-space: normal;
143}
144.edit-value dt {
145 margin-right: -7px;
146}
147.edit-value dd {
148 margin-left: 7px;
149}
141 150
142/* ------------------------ 151/* ------------------------
143 Empty Style (Add Style) 152 Empty Style (Add Style)
diff --git a/js/panels/css-panel/css-style.reel/css-style.js b/js/panels/css-panel/css-style.reel/css-style.js
index dee94e75..e0055dc6 100644
--- a/js/panels/css-panel/css-style.reel/css-style.js
+++ b/js/panels/css-panel/css-style.reel/css-style.js
@@ -57,6 +57,7 @@ exports.CssStyle = Montage.create(Component, {
57 delegate : { value: null }, 57 delegate : { value: null },
58 disabledClass : { value: 'style-item-disabled' }, 58 disabledClass : { value: 'style-item-disabled' },
59 editingStyleClass : { value: 'edit-style-item' }, 59 editingStyleClass : { value: 'edit-style-item' },
60 editingValueClass : { value: 'edit-value' },
60 editNewEmptyClass : { value: 'edit-empty-style' }, 61 editNewEmptyClass : { value: 'edit-empty-style' },
61 invalidStyleClass : { value: "style-item-invalid" }, 62 invalidStyleClass : { value: "style-item-invalid" },
62 emptyStyleClass : { value: "empty-css-style" }, 63 emptyStyleClass : { value: "empty-css-style" },
@@ -181,6 +182,18 @@ exports.CssStyle = Montage.create(Component, {
181 } 182 }
182 }, 183 },
183 184
185 _editingValue : { value: null },
186 editingValue : {
187 get : function() { return this._editingValue; },
188 set : function(value) {
189 if(value === this._editingValue) { return; }
190
191 this._editingValue = value;
192
193 this.needsDraw = true;
194 }
195 },
196
184 remove : { 197 remove : {
185 value: function() { 198 value: function() {
186 var branchController = this.parentComponent.parentComponent.contentController; 199 var branchController = this.parentComponent.parentComponent.contentController;
@@ -257,6 +270,9 @@ exports.CssStyle = Montage.create(Component, {
257 if(this.empty) { 270 if(this.empty) {
258 this.editingNewStyle = true; 271 this.editingNewStyle = true;
259 } 272 }
273
274 this.editingValue = (this.valueField.element === e._currentTarget.element);
275
260 } 276 }
261 }, 277 },
262 278
@@ -300,7 +316,7 @@ exports.CssStyle = Montage.create(Component, {
300 return false; 316 return false;
301 } 317 }
302 318
303 this.editing = false; 319 this.editing = this.editingValue = false;
304 320
305 if(this.empty && !this.dirty && !fieldsClicked.bind(this)()) { 321 if(this.empty && !this.dirty && !fieldsClicked.bind(this)()) {
306 ///// Show add button 322 ///// Show add button
@@ -457,6 +473,12 @@ exports.CssStyle = Montage.create(Component, {
457 } else { 473 } else {
458 this._element.classList.remove(this.editingStyleClass); 474 this._element.classList.remove(this.editingStyleClass);
459 } 475 }
476
477 if(this.editingValue) {
478 this._element.classList.add(this.editingValueClass);
479 } else {
480 this._element.classList.remove(this.editingValueClass);
481 }
460 } 482 }
461 } 483 }
462}); 484});
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 17a99697..f9706277 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -36,7 +36,6 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve
36var Montage = require("montage/core/core").Montage; 36var Montage = require("montage/core/core").Montage;
37var NJUtils = require("js/lib/NJUtils").NJUtils; 37var NJUtils = require("js/lib/NJUtils").NJUtils;
38var ElementMediator = require("js/mediators/element-mediator").ElementMediator; 38var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
39var TagTool = require("js/tools/TagTool").TagTool;
40var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager; 39var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager;
41var ViewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; 40var ViewUtils = require("js/helper-classes/3D/view-utils").ViewUtils;
42var BrushStroke = require("js/lib/geom/brush-stroke").BrushStroke; 41var BrushStroke = require("js/lib/geom/brush-stroke").BrushStroke;
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 4ec327b5..26222bc7 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -33,7 +33,6 @@ var Montage = require("montage/core/core").Montage,
33 ShapeTool = require("js/tools/ShapeTool").ShapeTool, 33 ShapeTool = require("js/tools/ShapeTool").ShapeTool,
34 DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase, 34 DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase,
35 NJUtils = require("js/lib/NJUtils").NJUtils, 35 NJUtils = require("js/lib/NJUtils").NJUtils,
36 TagTool = require("js/tools/TagTool").TagTool,
37 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, 36 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
38 ShapeModel = require("js/models/shape-model").ShapeModel; 37 ShapeModel = require("js/models/shape-model").ShapeModel;
39 38
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index a44438ac..1ebc7e83 100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -36,7 +36,6 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve
36var Montage = require("montage/core/core").Montage; 36var Montage = require("montage/core/core").Montage;
37var NJUtils = require("js/lib/NJUtils").NJUtils; 37var NJUtils = require("js/lib/NJUtils").NJUtils;
38var ElementMediator = require("js/mediators/element-mediator").ElementMediator; 38var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
39var TagTool = require("js/tools/TagTool").TagTool;
40var ElementController = require("js/controllers/elements/element-controller").ElementController; 39var ElementController = require("js/controllers/elements/element-controller").ElementController;
41var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager; 40var snapManager = require("js/helper-classes/3D/snap-manager").SnapManager;
42var ViewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; 41var ViewUtils = require("js/helper-classes/3D/view-utils").ViewUtils;
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index e1ca31e6..a4fd98e6 100755
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -33,8 +33,7 @@ var Montage = require("montage/core/core").Montage,
33 DrawingTool = require("js/tools/drawing-tool").DrawingTool, 33 DrawingTool = require("js/tools/drawing-tool").DrawingTool,
34 NJUtils = require("js/lib/NJUtils").NJUtils, 34 NJUtils = require("js/lib/NJUtils").NJUtils,
35 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, 35 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
36 ShapeModel = require("js/models/shape-model").ShapeModel, 36 ShapeModel = require("js/models/shape-model").ShapeModel;
37 TagTool = require("js/tools/TagTool").TagTool;
38 37
39var World = require("js/lib/drawing/world").World; 38var World = require("js/lib/drawing/world").World;
40 39