diff options
author | Armen Kesablyan | 2012-06-05 12:55:44 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-05 12:55:44 -0700 |
commit | 5ecbbe908a5527dc42d461c8ddfd33b4c7e0ba4f (patch) | |
tree | 76d796ac65f603746a5618849fd891f835677ad5 /js/panels/binding-panel.reel/binding-panel.js | |
parent | cd089f6692934a68bda7c303928a7c78dd13ac07 (diff) | |
parent | 9db979373f80162d463e23d400e97f37c75267d1 (diff) | |
download | ninja-5ecbbe908a5527dc42d461c8ddfd33b4c7e0ba4f.tar.gz |
Merge branch 'binding' of https://github.com/dhg637/ninja-internal into binding
Diffstat (limited to 'js/panels/binding-panel.reel/binding-panel.js')
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.js | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 9fdec416..c2ce556c 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js | |||
@@ -4,10 +4,34 @@ var Montage = require("montage/core/core").Montage, | |||
4 | 4 | ||
5 | exports.BindingPanel = Montage.create(Component, { | 5 | exports.BindingPanel = Montage.create(Component, { |
6 | 6 | ||
7 | bindings : { | 7 | bindings : { value: null }, |
8 | editView : { value: null }, | ||
9 | editingClass : { value: 'editing-binding' }, | ||
10 | _editing: { value: null }, | ||
11 | editing: { | ||
12 | get: function() { | ||
13 | return this._editing; | ||
14 | }, | ||
15 | set: function(value) { | ||
16 | if(value === this._editing) { return; } | ||
17 | this._editing = value; | ||
18 | this.needsDraw = true; | ||
19 | } | ||
20 | }, | ||
21 | _translateDistance : { | ||
8 | value: null | 22 | value: null |
9 | }, | 23 | }, |
10 | 24 | ||
25 | displayEditView : { | ||
26 | value: function(bindingArgs) { | ||
27 | this.editing = true; | ||
28 | } | ||
29 | }, | ||
30 | |||
31 | /* ------------------------- | ||
32 | Draw Cycle | ||
33 | ------------------------- */ | ||
34 | |||
11 | templateDidLoad : { | 35 | templateDidLoad : { |
12 | value: function() { | 36 | value: function() { |
13 | Object.defineBinding(this, 'bindings', { | 37 | Object.defineBinding(this, 'bindings', { |
@@ -18,9 +42,23 @@ exports.BindingPanel = Montage.create(Component, { | |||
18 | } | 42 | } |
19 | }, | 43 | }, |
20 | 44 | ||
21 | prepareForDraw: { | 45 | willDraw: { |
22 | value: function() { | 46 | value: function() { |
23 | console.log("test- objects"); | 47 | if(this.editing) { |
48 | this._translateDistance = this.element.offsetWidth; | ||
49 | } | ||
50 | } | ||
51 | }, | ||
52 | |||
53 | draw : { | ||
54 | value: function() { | ||
55 | var transStr = '-webkit-transform'; | ||
56 | |||
57 | if(this.editing) { | ||
58 | this.editView.element.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); | ||
59 | } else { | ||
60 | this.editView.element.style.removeProperty(transStr); | ||
61 | } | ||
24 | } | 62 | } |
25 | } | 63 | } |
26 | }); \ No newline at end of file | 64 | }); \ No newline at end of file |