diff options
author | Jon Reid | 2012-06-15 10:10:41 -0700 |
---|---|---|
committer | Jon Reid | 2012-06-15 10:10:41 -0700 |
commit | 526ac54f73d53e1e2a3d6a4dbf4f9992c143baf7 (patch) | |
tree | 65939e59615aaa10a7db77211e71616ad531bd0e /js/panels/properties.reel/sections/position-size.reel | |
parent | b5b760ee82e5cc4da176914983a6002cbf86c11a (diff) | |
parent | 5ee0c89fa0c7acc280ff3b884767e8513fd0b315 (diff) | |
download | ninja-526ac54f73d53e1e2a3d6a4dbf4f9992c143baf7.tar.gz |
Merge remote-tracking branch 'ninja-internal/master' into test-merge
Conflicts:
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
Diffstat (limited to 'js/panels/properties.reel/sections/position-size.reel')
-rwxr-xr-x | js/panels/properties.reel/sections/position-size.reel/position-size.html | 25 | ||||
-rwxr-xr-x | js/panels/properties.reel/sections/position-size.reel/position-size.js | 81 |
2 files changed, 86 insertions, 20 deletions
diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.html b/js/panels/properties.reel/sections/position-size.reel/position-size.html index 5d1a805a..d322f826 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.html +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.html | |||
@@ -29,10 +29,13 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
29 | "properties": { | 29 | "properties": { |
30 | "element": {"#": "PosX"}, | 30 | "element": {"#": "PosX"}, |
31 | "maxValue": 10000, | 31 | "maxValue": 10000, |
32 | "minValue": -10000 | 32 | "minValue": -10000, |
33 | "acceptableUnits" : ["px", "%"], | ||
34 | "units": "px" | ||
33 | }, | 35 | }, |
34 | "bindings": { | 36 | "bindings": { |
35 | "value": {"<<->": "@owner.leftPosition"} | 37 | "units": {"<->": "@owner.leftUnits"}, |
38 | "value": {"<->": "@owner.leftPosition"} | ||
36 | } | 39 | } |
37 | }, | 40 | }, |
38 | "PosY": { | 41 | "PosY": { |
@@ -40,20 +43,26 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
40 | "properties": { | 43 | "properties": { |
41 | "element": {"#": "PosY"}, | 44 | "element": {"#": "PosY"}, |
42 | "maxValue": 10000, | 45 | "maxValue": 10000, |
43 | "minValue": -10000 | 46 | "minValue": -10000, |
47 | "acceptableUnits" : ["px", "%"], | ||
48 | "units": "px" | ||
44 | }, | 49 | }, |
45 | "bindings": { | 50 | "bindings": { |
46 | "value": {"<<->": "@owner.topPosition"} | 51 | "units": {"<->": "@owner.topUnits"}, |
52 | "value": {"<->": "@owner.topPosition"} | ||
47 | } | 53 | } |
48 | }, | 54 | }, |
49 | 55 | ||
50 | "PosH": { | 56 | "PosH": { |
51 | "prototype": "js/components/hottextunit.reel[HotTextUnit]", | 57 | "prototype": "js/components/hottextunit.reel[HotTextUnit]", |
52 | "properties": { | 58 | "properties": { |
53 | "element": {"#": "PosH"} | 59 | "element": {"#": "PosH"}, |
60 | "acceptableUnits" : ["px", "%"], | ||
61 | "units": "px" | ||
54 | }, | 62 | }, |
55 | "bindings": { | 63 | "bindings": { |
56 | "value": {"<<->": "@owner.heightSize"} | 64 | "units": {"<->": "@owner.heightUnits"}, |
65 | "value": {"<->": "@owner.heightSize"} | ||
57 | } | 66 | } |
58 | }, | 67 | }, |
59 | 68 | ||
@@ -65,7 +74,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
65 | "units": "px" | 74 | "units": "px" |
66 | }, | 75 | }, |
67 | "bindings": { | 76 | "bindings": { |
68 | "value": {"<<->": "@owner.widthSize"} | 77 | "units": {"<->": "@owner.widthUnits"}, |
78 | "value": {"<->": "@owner.widthSize"} | ||
69 | } | 79 | } |
70 | 80 | ||
71 | }, | 81 | }, |
@@ -74,7 +84,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
74 | "properties": { | 84 | "properties": { |
75 | "element": {"#": "posBound"}, | 85 | "element": {"#": "posBound"}, |
76 | "pressedClass": "lockUp", | 86 | "pressedClass": "lockUp", |
77 | "preventFocus": true, | ||
78 | "identifier": "ratio" | 87 | "identifier": "ratio" |
79 | } | 88 | } |
80 | } | 89 | } |
diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js index 7c24e02a..94c0bbf2 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.js +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js | |||
@@ -8,21 +8,78 @@ var Montage = require("montage/core/core").Montage; | |||
8 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | exports.PositionSize = Montage.create(Component, { | 10 | exports.PositionSize = Montage.create(Component, { |
11 | |||
12 | position: { | ||
13 | value: null, | ||
14 | serializable: true | ||
15 | }, | ||
16 | |||
17 | leftLabel: { | ||
18 | value: null, | ||
19 | serializable: true | ||
20 | }, | ||
21 | |||
22 | leftControl: { | ||
23 | value: null, | ||
24 | serializable: true | ||
25 | }, | ||
26 | |||
27 | topLabel: { | ||
28 | value: null, | ||
29 | serializable: true | ||
30 | }, | ||
31 | |||
32 | topControl: { | ||
33 | value: null, | ||
34 | serializable: true | ||
35 | }, | ||
36 | |||
37 | heightControl: { | ||
38 | value: null, | ||
39 | serializable: true | ||
40 | }, | ||
41 | |||
42 | widthControl: { | ||
43 | value: null, | ||
44 | serializable: true | ||
45 | }, | ||
46 | |||
47 | bindButton: { | ||
48 | value: null, | ||
49 | serializable: true | ||
50 | }, | ||
51 | |||
11 | leftPosition: { | 52 | leftPosition: { |
12 | value: 0 | 53 | value: 0 |
13 | }, | 54 | }, |
14 | 55 | ||
56 | leftUnits: { | ||
57 | value: "px" | ||
58 | }, | ||
59 | |||
15 | topPosition: { | 60 | topPosition: { |
16 | value: 0 | 61 | value: 0 |
17 | }, | 62 | }, |
18 | 63 | ||
64 | topUnits: { | ||
65 | value: "px" | ||
66 | }, | ||
67 | |||
19 | heightSize: { | 68 | heightSize: { |
20 | value: 0 | 69 | value: 0 |
21 | }, | 70 | }, |
22 | 71 | ||
72 | heightUnits: { | ||
73 | value: "px" | ||
74 | }, | ||
75 | |||
23 | widthSize: { | 76 | widthSize: { |
24 | value: 0 | 77 | value: 0 |
25 | }, | 78 | }, |
79 | |||
80 | widthUnits: { | ||
81 | value: "px" | ||
82 | }, | ||
26 | /* | 83 | /* |
27 | widthSize: { | 84 | widthSize: { |
28 | get: function() { return this._widthSize;}, | 85 | get: function() { return this._widthSize;}, |
@@ -132,7 +189,7 @@ exports.PositionSize = Montage.create(Component, { | |||
132 | if(!event.wasSetByCode) { | 189 | if(!event.wasSetByCode) { |
133 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 190 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
134 | 191 | ||
135 | this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + "px"] , "Change", "pi", prevPosition); | 192 | this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + this.leftControl.units] , "Change", "pi", prevPosition); |
136 | this.savedPosition = null; | 193 | this.savedPosition = null; |
137 | } | 194 | } |
138 | } | 195 | } |
@@ -145,7 +202,7 @@ exports.PositionSize = Montage.create(Component, { | |||
145 | if(!event.wasSetByCode) { | 202 | if(!event.wasSetByCode) { |
146 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 203 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
147 | 204 | ||
148 | this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition); | 205 | this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + this.topControl.units] , "Change", "pi", prevPosition); |
149 | this.savedPosition = null; | 206 | this.savedPosition = null; |
150 | } | 207 | } |
151 | } | 208 | } |
@@ -156,7 +213,7 @@ exports.PositionSize = Montage.create(Component, { | |||
156 | var prevPosition, items; | 213 | var prevPosition, items; |