aboutsummaryrefslogtreecommitdiff
path: root/js/components/tools-properties/fill-properties.reel/fill-properties.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-05-17 14:01:38 -0700
committerArmen Kesablyan2012-05-17 14:01:38 -0700
commit6c8f3525b839e82cf43df43700a0160ee2c5458f (patch)
tree3fb801fa54b759c5568d75bb467e02652ce77c3e /js/components/tools-properties/fill-properties.reel/fill-properties.js
parente8ae5db7ce7023b638375cbc27a3f7b7a2f77b23 (diff)
parent342c97ac9b727b22a7b0bfefca4d2a168bc3055b (diff)
downloadninja-6c8f3525b839e82cf43df43700a0160ee2c5458f.tar.gz
Merge branch 'refs/heads/dom-architecture' into binding
Conflicts: css/ninja.css scss/imports/scss/_toolbar.scss Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/components/tools-properties/fill-properties.reel/fill-properties.js')
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.js51
1 files changed, 48 insertions, 3 deletions
diff --git a/js/components/tools-properties/fill-properties.reel/fill-properties.js b/js/components/tools-properties/fill-properties.reel/fill-properties.js
index 61b667d7..ae136956 100755
--- a/js/components/tools-properties/fill-properties.reel/fill-properties.js
+++ b/js/components/tools-properties/fill-properties.reel/fill-properties.js
@@ -8,10 +8,55 @@ var Montage = require("montage/core/core").Montage,
8 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, 8 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
9 ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; 9 ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
10 10
11exports.FillProperties = Montage.create(ToolProperties, { 11var FillProperties = exports.FillProperties = Montage.create(ToolProperties, {
12
13 _use3D: { value: false },
14 addedColorChips: { value: false },
15
16 _fill: {
17 enumerable: false,
18 value: { colorMode: 'rgb', color: { r: 0, g: 0, b: 0, a: 1, css: 'rgb(0,0,0)', mode: 'rgb', wasSetByCode: true, type: 'change' }, webGlColor: [0, 0, 0, 1] }
19 },
20
21 fill: {
22 enumerable: true,
23 get: function () {
24 return this._fill;
25 },
26 set: function (value) {
27 if (value !== this._fill) {
28 this._fill = value;
29 }
30 }
31 },
32
33 draw: {
34 enumerable: false,
35 value: function () {
36 Object.getPrototypeOf(FillProperties).draw.call(this);
37
38 if (this.addedColorChips === false && this.application.ninja.colorController.colorPanelDrawn) {
39 this._fillColorCtrl.props = { side: 'top', align: 'center', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: -80 };
40 this.application.ninja.colorController.addButton("chip", this._fillColorCtrl);
41
42 this._fillColorCtrl.addEventListener("change", this.handleFillColorChange.bind(this), false);
43
44 this.addedColorChips = true;
45 }
46
47 if (this.addedColorChips) {
48 this._fillColorCtrl.color(this._fill.colorMode, this._fill.color);
49 }
50 }
51 },
52
53 handleFillColorChange: {
54 value: function (e) {
55 this.fill = e._event;
56 this.fill.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color);
57 }
58 },
12 59
13 _use3D: { value: false },
14
15 _subPrepare: { 60 _subPrepare: {
16 value: function() { 61 value: function() {
17 Object.defineBinding(this._fillMaterial, "items", { 62 Object.defineBinding(this._fillMaterial, "items", {