aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
Diffstat (limited to 'js/components')
-rw-r--r--js/components/converter/string-units-converter.js2
-rw-r--r--js/components/converter/string-value-converter.js2
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js42
-rwxr-xr-xjs/components/tools-properties/pen-properties.reel/pen-properties.js27
4 files changed, 43 insertions, 30 deletions
diff --git a/js/components/converter/string-units-converter.js b/js/components/converter/string-units-converter.js
index 6b97d5c5..9f6e4112 100644
--- a/js/components/converter/string-units-converter.js
+++ b/js/components/converter/string-units-converter.js
@@ -9,7 +9,6 @@ var Montage = require("montage").Montage,
9 9
10exports.StringUnitsConverter = Montage.create(Converter, { 10exports.StringUnitsConverter = Montage.create(Converter, {
11 11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: { 12 convert: {
14 value: function(value) { 13 value: function(value) {
15 if(value) { 14 if(value) {
@@ -20,7 +19,6 @@ exports.StringUnitsConverter = Montage.create(Converter, {
20 } 19 }
21 }, 20 },
22 21
23 // revert celsius to fahrenheit
24 revert: { 22 revert: {
25 value: function(value) { 23 value: function(value) {
26 console.log("revert string to unit ", value); 24 console.log("revert string to unit ", value);
diff --git a/js/components/converter/string-value-converter.js b/js/components/converter/string-value-converter.js
index 28d7dd29..f397f731 100644
--- a/js/components/converter/string-value-converter.js
+++ b/js/components/converter/string-value-converter.js
@@ -9,7 +9,6 @@ var Montage = require("montage").Montage,
9 9
10exports.StringValueConverter = Montage.create(Converter, { 10exports.StringValueConverter = Montage.create(Converter, {
11 11
12 // convert fahrenheit to celsius (showing our non-metric heritage here)
13 convert: { 12 convert: {
14 value: function(value) { 13 value: function(value) {
15 console.log(value); 14 console.log(value);
@@ -18,7 +17,6 @@ exports.StringValueConverter = Montage.create(Converter, {
18 } 17 }
19 }, 18 },
20 19
21 // revert celsius to fahrenheit
22 revert: { 20 revert: {
23 value: function(value) { 21 value: function(value) {
24 console.log("revert string to value ", value); 22 console.log("revert string to value ", value);
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index d525c813..2f493102 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -56,22 +56,6 @@ exports.Breadcrumb = Montage.create(Component, {
56 } 56 }
57 }, 57 },
58 58
59 _container:{
60 value:null
61 },
62
63 container: {
64 set: function(value) {
65 if(this._container !== value) {
66 this._container = value;
67 this.createContainerElements();
68 }
69 },
70 get: function() {
71 return this._container;
72 }
73 },
74
75 containerElements: { 59 containerElements: {
76 value: [] 60 value: []
77 }, 61 },
@@ -79,31 +63,37 @@ exports.Breadcrumb = Montage.create(Component, {
79 prepareForDraw: { 63 prepareForDraw: {
80 value: function() { 64 value: function() {
81 this.breadcrumbBt.addEventListener("action", this, false); 65 this.breadcrumbBt.addEventListener("action", this, false);
66 this.addPropertyChangeListener("currentDocument.model.domContainer", this)
82 } 67 }
83 }, 68 },
84 69
85 createContainerElements: { 70 handleChange: {
86 value: function() { 71 value: function() {
87 var parentNode; 72 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
73 this.createContainerElements(this.currentDocument.model.getProperty("domContainer"));
74 }
75 }
76 },
77
78 createContainerElements: {
79 value: function(container) {
88 80
89// delete this.containerElements; 81// delete this.containerElements;
90 this.containerElements = []; 82 this.containerElements = [];
91 83
92 parentNode = this.container; 84 while(container !== this.currentDocument.model.documentRoot) {
93 85 this.containerElements.unshift({"node": container, "nodeUuid":container.uuid, "label": container.nodeName});
94 while(parentNode !== this.currentDocument.model.documentRoot) { 86 container = container.parentNode;
95 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
96 parentNode = parentNode.parentNode;
97 } 87 }
98 88
99 // This is always the top container which is now hardcoded to body 89 // This is always the top container which is now hardcoded to body
100 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); 90 this.containerElements.unshift({"node": container, "nodeUuid":container.uuid, "label": container.nodeName});
101 } 91 }
102 }, 92 },
103 93
104 handleAction: { 94 handleAction: {
105 value: function(evt) { 95 value: function(evt) {
106 if(evt.target.value === this.container.uuid) { 96 if(evt.target.value === this.currentDocument.model.domContainer.uuid) {
107 return; 97 return;
108 } 98 }
109 99
@@ -114,7 +104,7 @@ exports.Breadcrumb = Montage.create(Component, {
114 } 104 }
115 105
116 // TODO: This is bound 2 ways, update the internal property 106 // TODO: This is bound 2 ways, update the internal property
117 this.application.ninja.currentSelectedContainer = this.containerElements[i].node; 107 this.currentDocument.model.domContainer = this.containerElements[i].node;
118 } 108 }
119 } 109 }
120}); 110});
diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.js b/js/components/tools-properties/pen-properties.reel/pen-properties.js
index 2bb4d3e9..5ae03adc 100755
--- a/js/components/tools-properties/pen-properties.reel/pen-properties.js
+++ b/js/components/tools-properties/pen-properties.reel/pen-properties.js
@@ -9,6 +9,17 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T
9 9
10var PenProperties = exports.PenProperties = Montage.create(ToolProperties, { 10var PenProperties = exports.PenProperties = Montage.create(ToolProperties, {
11 addedColorChips: { value: false }, 11 addedColorChips: { value: false },
12 _penToolRadio: { value: null, enumerable: false },
13 _penPlusRadio: { value: null, enumerable: false },
14 _penMinusRadio: { value: null, enumerable: false },
15
16 _subPrepare: {
17 value: function() {
18 this._penToolRadio.addEventListener("click", this, false);
19 this._penPlusRadio.addEventListener("click", this, false);
20 this._penMinusRadio.addEventListener("click", this, false);
21 }
22 },
12 23
13 _fillColorCtrl: { 24 _fillColorCtrl: {
14 value: null, 25 value: null,
@@ -65,6 +76,22 @@ var PenProperties = exports.PenProperties = Montage.create(ToolProperties, {
65 } 76 }
66 }, 77 },
67 78
79 _selectedSubtool: {
80 value: "pen", enumerable: false
81 },
82
83 selectedSubtool: {
84 get: function() { return this._selectedSubtool;},
85 set: function(value) { this._selectedSubtool = value; }
86 },
87
88 handleClick: {
89 value: function(event) {
90 this._selectedSubtool = event._event.target.value;
91 NJevent("penSubToolChange");
92 }
93 },
94
68 draw: { 95 draw: {
69 enumerable: false, 96 enumerable: false,
70 value: function () { 97 value: function () {