aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/tag-properties.reel/tag-properties.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-05-07 14:30:47 -0700
committerJohn Mayhew2012-05-07 14:30:47 -0700
commit29ad6355ef60cfb3b3fc7f780504f3ed30845883 (patch)
treebbe2dcd46c98db8138ad0a8f0263ef33324d7669 /js/components/tools-properties/tag-properties.reel/tag-properties.js
parent1a759361b82127f9d5c1428dc889fffdf2daaf86 (diff)
downloadninja-29ad6355ef60cfb3b3fc7f780504f3ed30845883.tar.gz
More implementation of moving color chips to the individual subtools.
Removed the tool color bar Added new icons for inkbottle Removed Pencil tool Removed Inkbottle tool Added chips to the pen, brush and tag tools Aligned controls in several subtools
Diffstat (limited to 'js/components/tools-properties/tag-properties.reel/tag-properties.js')
-rwxr-xr-xjs/components/tools-properties/tag-properties.reel/tag-properties.js47
1 files changed, 46 insertions, 1 deletions
diff --git a/js/components/tools-properties/tag-properties.reel/tag-properties.js b/js/components/tools-properties/tag-properties.reel/tag-properties.js
index 1caabc35..32063d9a 100755
--- a/js/components/tools-properties/tag-properties.reel/tag-properties.js
+++ b/js/components/tools-properties/tag-properties.reel/tag-properties.js
@@ -8,7 +8,7 @@ var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; 9var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
10 10
11exports.TagProperties = Montage.create(ToolProperties, { 11var TagProperties = exports.TagProperties = Montage.create(ToolProperties, {
12 divElement: { value: null, enumerable: false }, 12 divElement: { value: null, enumerable: false },
13 imageElement: { value: null, enumerable: false }, 13 imageElement: { value: null, enumerable: false },
14 videoElement: { value: null, enumerable: false }, 14 videoElement: { value: null, enumerable: false },
@@ -17,6 +17,24 @@ exports.TagProperties = Montage.create(ToolProperties, {
17 classField: { value: null, enumerable: false }, 17 classField: { value: null, enumerable: false },
18 customName: { value: null, enumerable: false }, 18 customName: { value: null, enumerable: false },
19 customLabel: { value: null, enumerable: false }, 19 customLabel: { value: null, enumerable: false },
20 addedColorChips: { value: false },
21
22 _fill: {
23 enumerable: false,
24 value: { colorMode: 'nocolor', color: null, webGlColor: null }
25 },
26
27 fill: {
28 enumerable: true,
29 get: function () {
30 return this._fill;
31 },
32 set: function (value) {
33 if (value !== this._fill) {
34 this._fill = value;
35 }
36 }
37 },
20 38
21 _subPrepare: { 39 _subPrepare: {
22 value: function() { 40 value: function() {
@@ -31,6 +49,33 @@ exports.TagProperties = Montage.create(ToolProperties, {
31 } 49 }
32 }, 50 },
33 51
52 draw: {
53 enumerable: false,
54 value: function () {
55 Object.getPrototypeOf(TagProperties).draw.call(this);
56
57 if (this.addedColorChips === false && this.application.ninja.colorController.colorPanelDrawn) {
58 this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 };
59 this.application.ninja.colorController.addButton("chip", this._fillColorCtrl);
60
61 this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false);
62
63 this.addedColorChips = true;
64 }
65
66 if (this.addedColorChips) {
67 this._fillColorCtrl.color(this._fill.colorMode, this._fill.color);
68 }
69 }
70 },
71
72 handleFillColorChange: {
73 value: function (e) {
74 this.fill = e._event;
75 this.fill.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color);
76 }
77 },
78
34 handleClick: { 79 handleClick: {
35 value: function(event) { 80 value: function(event) {
36 this.selectedElement = event._event.target.id; 81 this.selectedElement = event._event.target.id;