diff options
author | Ananya Sen | 2012-06-04 10:43:29 -0700 |
---|---|---|
committer | Ananya Sen | 2012-06-04 10:43:29 -0700 |
commit | 6fb29883329c9c42a8b406128b92c0e6323a47be (patch) | |
tree | 07f46e88bccf9cdb7d4e6818e1b646b0d19f05b9 /js/panels | |
parent | cf097ec69e35c07ecae5a105ed5eeb78291c9ac2 (diff) | |
parent | c1ec69879028220b0c3f11ad6e24035bf527802c (diff) | |
download | ninja-6fb29883329c9c42a8b406128b92c0e6323a47be.tar.gz |
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts:
js/ninja.reel/ninja.html
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/panels')
20 files changed, 310 insertions, 178 deletions
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index b4a803b2..b496ce4a 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | |||
@@ -57,11 +57,6 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre | |||
57 | 57 | ||
58 | this.eventManager.addEventListener("selectionChange", this, true); | 58 | this.eventManager.addEventListener("selectionChange", this, true); |
59 | this.eventManager.addEventListener("elementChange", this, true); | 59 | this.eventManager.addEventListener("elementChange", this, true); |
60 | this.eventManager.addEventListener("openDocument", this, true); | ||
61 | |||
62 | if(this.application.ninja.currentDocument) { | ||
63 | this.captureOpenDocument(); | ||
64 | } | ||
65 | 60 | ||
66 | this.addEventListener('webkitTransitionEnd', this, false); | 61 | this.addEventListener('webkitTransitionEnd', this, false); |
67 | ['sheets', 'styles'].forEach(function(section) { | 62 | ['sheets', 'styles'].forEach(function(section) { |
@@ -73,11 +68,29 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre | |||
73 | this._setUpToolbars(); | 68 | this._setUpToolbars(); |
74 | } | 69 | } |
75 | }, | 70 | }, |
76 | captureOpenDocument : { | 71 | |
77 | value : function(e) { | 72 | _currentDocument: { |
78 | this.populateStyleSheetList(); | 73 | value : null, |
74 | enumerable : false | ||
75 | }, | ||
76 | |||
77 | currentDocument : { | ||
78 | get : function() { | ||
79 | return this._currentDocument; | ||
80 | }, | ||
81 | set : function(value) { | ||
82 | if (value === this._currentDocument) { | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | this._currentDocument = value; | ||
87 | |||
88 | if(this._currentDocument.currentView === "design") { | ||
89 | this.populateStyleSheetList(); | ||
90 | } | ||
79 | } | 91 | } |
80 | }, | 92 | }, |
93 | |||
81 | handleWebkitTransitionEnd : { | 94 | handleWebkitTransitionEnd : { |
82 | value: function(e) { | 95 | value: function(e) { |
83 | //console.log('transition end at panel base'); | 96 | //console.log('transition end at panel base'); |
diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index 613bef4b..0c5f0b4b 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js | |||
@@ -100,6 +100,35 @@ exports.Panel = Montage.create(Component, { | |||
100 | } | 100 | } |
101 | }, | 101 | }, |
102 | 102 | ||
103 | _currentDocument: { | ||
104 | value : null, | ||
105 | enumerable : false | ||
106 | }, | ||
107 | |||
108 | currentDocument : { | ||
109 | get : function() { | ||
110 | return this._currentDocument; | ||
111 | }, | ||
112 | set : function(value) { | ||
113 | if (value === this._currentDocument) { | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | this._currentDocument = value; | ||
118 | |||
119 | if(typeof this.panelContent.content[0].controller._currentDocument !== "undefined") { | ||
120 | this.panelContent.content[0].controller.currentDocument = this._currentDocument; | ||
121 | } | ||
122 | |||
123 | if(!value) { | ||
124 | this.disabled = true; | ||
125 | } else { | ||
126 | this.disabled = this._currentDocument.currentView !== "design"; | ||
127 | } | ||
128 | |||
129 | } | ||
130 | }, | ||
131 | |||
103 | handleBtnCollapseAction: { | 132 | handleBtnCollapseAction: { |
104 | value: function() { | 133 | value: function() { |
105 | this.collapsed = !this.collapsed; | 134 | this.collapsed = !this.collapsed; |
diff --git a/js/panels/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer.reel/PanelContainer.html index 1c144bf4..b22b3609 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.html +++ b/js/panels/PanelContainer.reel/PanelContainer.html | |||
@@ -17,6 +17,9 @@ | |||
17 | "prototype": "js/panels/Panel.reel", | 17 | "prototype": "js/panels/Panel.reel", |
18 | "properties": { | 18 | "properties": { |
19 | "element": {"#": "panel_0"} | 19 | "element": {"#": "panel_0"} |
20 | }, | ||
21 | "bindings": { | ||
22 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
20 | } | 23 | } |
21 | }, | 24 | }, |
22 | 25 | ||
@@ -24,6 +27,9 @@ | |||
24 | "prototype": "js/panels/Panel.reel", | 27 | "prototype": "js/panels/Panel.reel", |
25 | "properties": { | 28 | "properties": { |
26 | "element": {"#": "panel_1"} | 29 | "element": {"#": "panel_1"} |
30 | }, | ||
31 | "bindings": { | ||
32 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
27 | } | 33 | } |
28 | }, | 34 | }, |
29 | 35 | ||
@@ -31,6 +37,9 @@ | |||
31 | "prototype": "js/panels/Panel.reel", | 37 | "prototype": "js/panels/Panel.reel", |
32 | "properties": { | 38 | "properties": { |
33 | "element": {"#": "panel_2"} | 39 | "element": {"#": "panel_2"} |
40 | }, | ||
41 | "bindings": { | ||
42 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
34 | } | 43 | } |
35 | }, | 44 | }, |
36 | 45 | ||
@@ -38,6 +47,9 @@ | |||
38 | "prototype": "js/panels/Panel.reel", | 47 | "prototype": "js/panels/Panel.reel", |
39 | "properties": { | 48 | "properties": { |
40 | "element": {"#": "panel_3"} | 49 | "element": {"#": "panel_3"} |
50 | }, | ||
51 | "bindings": { | ||
52 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
41 | } | 53 | } |
42 | }, | 54 | }, |
43 | 55 | ||
@@ -45,6 +57,9 @@ | |||
45 | "prototype": "js/panels/Panel.reel", | 57 | "prototype": "js/panels/Panel.reel", |
46 | "properties": { | 58 | "properties": { |
47 | "element": {"#": "panel_4"} | 59 | "element": {"#": "panel_4"} |
60 | }, | ||
61 | "bindings": { | ||
62 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
48 | } | 63 | } |
49 | }, | 64 | }, |
50 | 65 | ||
@@ -52,6 +67,9 @@ | |||
52 | "prototype": "js/panels/Panel.reel", | 67 | "prototype": "js/panels/Panel.reel", |
53 | "properties": { | 68 | "properties": { |
54 | "element": {"#": "panel_5"} | 69 | "element": {"#": "panel_5"} |
70 | }, | ||
71 | "bindings": { | ||
72 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
55 | } | 73 | } |
56 | }, | 74 | }, |
57 | 75 | ||
@@ -60,6 +78,9 @@ | |||
60 | "name": "Panel", | 78 | "name": "Panel", |
61 | "properties": { | 79 | "properties": { |
62 | "element": {"#": "panel_6"} | 80 | "element": {"#": "panel_6"} |
81 | }, | ||
82 | "bindings": { | ||
83 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
63 | } | 84 | } |
64 | }, | 85 | }, |
65 | 86 | ||
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 8d1d6a5e..7cb03255 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js | |||
@@ -16,7 +16,24 @@ exports.PanelContainer = Montage.create(Component, { | |||
16 | value: null | 16 | value: null |
17 | }, | 17 | }, | <