aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/shape-properties.reel/shape-properties.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/tools-properties/shape-properties.reel/shape-properties.js')
-rw-r--r--js/components/tools-properties/shape-properties.reel/shape-properties.js77
1 files changed, 77 insertions, 0 deletions
diff --git a/js/components/tools-properties/shape-properties.reel/shape-properties.js b/js/components/tools-properties/shape-properties.reel/shape-properties.js
new file mode 100644
index 00000000..b0d674cc
--- /dev/null
+++ b/js/components/tools-properties/shape-properties.reel/shape-properties.js
@@ -0,0 +1,77 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
9 ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
10
11exports.ShapeProperties = Montage.create(ToolProperties, {
12 toolsData: { value: null },
13 _use3D: { value: false },
14
15 _subPrepare: {
16 value: function() {
17 this.rectProperties.visible = true;
18
19 ShapesController.DisplayMaterials(this._strokeMaterial);
20 ShapesController.DisplayMaterials(this._fillMaterial);
21
22 this.handleChange(null);
23 this._useWebGL.addEventListener("change", this, false);
24 }
25 },
26
27 _selectedSubTool: { value: null, enumerable: false},
28
29 selectedSubTool : {
30 get: function() { return this._selectedSubTool;},
31 set: function(value) {
32 if(value) {
33
34 this._selectedSubTool? this[this._selectedSubTool.properties].visible = false : this.rectProperties.visible = false;
35
36 this._selectedSubTool = value;
37 this[this._selectedSubTool.properties].visible = true;
38
39 if(this._selectedSubTool.id === "LineTool") {
40 this._fillIcon.style["display"] = "none";
41 this._fillMaterial.style["display"] = "none";
42 } else {
43 this._fillIcon.style["display"] = "";
44 this._fillMaterial.style["display"] = "";
45 }
46
47 }
48 }
49 },
50
51 handleChange: {
52 value: function(event) {
53 if(this._useWebGL.checked)
54 {
55 this._use3D = true;
56 this._materialLabel.style["display"] = "";
57 this._strokeIcon.style["display"] = "";
58 this._strokeMaterial.style["display"] = "";
59 if(this.selectedSubTool.id !== "LineTool")
60 {
61 this._fillIcon.style["display"] = "";
62 this._fillMaterial.style["display"] = "";
63 }
64 }
65 else
66 {
67 this._use3D = false;
68 this._materialLabel.style["display"] = "none";
69 this._strokeIcon.style["display"] = "none";
70 this._strokeMaterial.style["display"] = "none";
71 this._fillIcon.style["display"] = "none";
72 this._fillMaterial.style["display"] = "none";
73 }
74 }
75 }
76
77});