diff options
Diffstat (limited to 'js/panels')
7 files changed, 52 insertions, 15 deletions
diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js index e0ffb1a8..54181bf3 100644 --- a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js | |||
@@ -88,6 +88,14 @@ exports.CssStyleRule = Montage.create(Component, { | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | }, | 90 | }, |
91 | handleStop : { | ||
92 | value: function(e) { | ||
93 | if(this.focusDelegate) { | ||
94 | e._event.detail.preventDefault(); | ||
95 | this.focusDelegate.handleSelectorStop(this.rule, this.selectorField.value, this); | ||
96 | } | ||
97 | } | ||
98 | }, | ||
91 | handleMouseover: { | 99 | handleMouseover: { |
92 | value: function(e) { | 100 | value: function(e) { |
93 | if(this.focusDelegate) { | 101 | if(this.focusDelegate) { |
@@ -125,6 +133,7 @@ exports.CssStyleRule = Montage.create(Component, { | |||
125 | this.declarationComponent.type = 'inline'; | 133 | this.declarationComponent.type = 'inline'; |
126 | } else { | 134 | } else { |
127 | this.selectorField.addEventListener('change', this, false); | 135 | this.selectorField.addEventListener('change', this, false); |
136 | this.selectorField.addEventListener('stop', this, false); | ||
128 | this.selectorField.element.addEventListener('mouseover', this, false); | 137 | this.selectorField.element.addEventListener('mouseover', this, false); |
129 | this.selectorField.element.addEventListener('mouseout', this, false); | 138 | this.selectorField.element.addEventListener('mouseout', this, false); |
130 | } | 139 | } |
diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js index e2e269ba..c7766d08 100644 --- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js +++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js | |||
@@ -45,7 +45,7 @@ exports.RuleListContainer = Montage.create(Component, { | |||
45 | for(i = 0; i<this.ruleLists.length; i++) { | 45 | for(i = 0; i<this.ruleLists.length; i++) { |
46 | list = this.ruleLists[i]; | 46 | list = this.ruleLists[i]; |
47 | 47 | ||
48 | if(selection.length > 1) { | 48 | if(selection.length === list.selection.length) { |
49 | matchesAll = selection.every(function(element, index, array) { | 49 | matchesAll = selection.every(function(element, index, array) { |
50 | return list.selection.indexOf(element) !== -1; | 50 | return list.selection.indexOf(element) !== -1; |
51 | }); | 51 | }); |
@@ -53,12 +53,6 @@ exports.RuleListContainer = Montage.create(Component, { | |||
53 | if(matchesAll) { | 53 | if(matchesAll) { |
54 | break; | 54 | break; |
55 | } | 55 | } |
56 | } else { | ||
57 | ///// Selection (single element or stylesheet) is the same, | ||
58 | ///// Use the existing rule list | ||
59 | if(list.selection[0] === selection[0]) { | ||
60 | break; | ||
61 | } | ||
62 | } | 56 | } |
63 | 57 | ||
64 | list = null; | 58 | list = null; |
diff --git a/js/panels/css-panel/style-declaration.reel/style-declaration.css b/js/panels/css-panel/style-declaration.reel/style-declaration.css index 6be8d33c..d4755b04 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.css +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.css | |||
@@ -10,4 +10,7 @@ | |||
10 | } | 10 | } |
11 | .drag-over { | 11 | .drag-over { |
12 | /*background-color: red;*/ | 12 | /*background-color: red;*/ |
13 | } | ||
14 | .css-animation-prevent * { | ||
15 | -webkit-transition-duration: 0 !important; | ||
13 | } \ No newline at end of file | 16 | } \ No newline at end of file |
diff --git a/js/panels/css-panel/style-declaration.reel/style-declaration.js b/js/panels/css-panel/style-declaration.reel/style-declaration.js index 57cbdb63..6187989b 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.js +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.js | |||
@@ -216,7 +216,15 @@ exports.StyleDeclaration = Montage.create(Component, { | |||
216 | }, | 216 | }, |
217 | 217 | ||
218 | addNewStyle : { | 218 | addNewStyle : { |
219 | value: function() { | 219 | value: function(preventAnimation) { |
220 | if(preventAnimation) { | ||
221 | this.element.classList.add('css-animation-prevent'); | ||
222 | |||
223 | setTimeout(function() { | ||
224 | this.element.classList.remove('css-animation-prevent'); | ||
225 | }.bind(this), 1000); | ||
226 | } | ||
227 | |||
220 | this.addStyle('property', 'value', { | 228 | this.addStyle('property', 'value', { |
221 | isEmpty : true | 229 | isEmpty : true |
222 | }); | 230 | }); |
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index 454008fa..078bd521 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js | |||
@@ -75,6 +75,13 @@ exports.StylesViewDelegate = Montage.create(Component, { | |||
75 | this._dispatchChange(); | 75 | this._dispatchChange(); |
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | |||
79 | handleSelectorStop : { | ||
80 | value: function(rule, newSelector, ruleComponent) { | ||
81 | ruleComponent.declarationComponent.repetition.childComponents[0].propertyField.start() | ||
82 | } | ||
83 | }, | ||
84 | |||
78 | _getClassNameFromSelector : { | 85 | _getClassNameFromSelector : { |
79 | value: function(selectorText) { | 86 | value: function(selectorText) { |
80 | var results = /.*\.([A-Za-z0-9_-]+)\:?[A-Za-z0-9_"=-]*$/.exec(selectorText); | 87 | var results = /.*\.([A-Za-z0-9_-]+)\:?[A-Za-z0-9_"=-]*$/.exec(selectorText); |
@@ -145,7 +152,7 @@ exports.StylesViewDelegate = Montage.create(Component, { | |||
145 | if(nextFocus) { | 152 | if(nextFocus) { |
146 | nextFocus.propertyField.start(); | 153 | nextFocus.propertyField.start(); |
147 | } else if(style.dirty) { | 154 | } else if(style.dirty) { |
148 | style.parentComponent.parentComponent.addNewStyle(); | 155 | style.parentComponent.parentComponent.addNewStyle(true); |
149 | style.editingNewStyle = false; | 156 | style.editingNewStyle = false; |
150 | setTimeout(function() { | 157 | setTimeout(function() { |
151 | style.getSiblingStyle('next').propertyField.start(); | 158 | style.getSiblingStyle('next').propertyField.start(); |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index d05fb058..934a3851 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js | |||
@@ -28,15 +28,17 @@ exports.Properties = Montage.create(Component, { | |||
28 | 28 | ||
29 | this._currentDocument = value; | 29 | this._currentDocument = value; |
30 | 30 | ||
31 | if(!value) { | 31 | // if(!value) { |
32 | this.clear(); | 32 | this.clear(); |
33 | } else if(this._currentDocument.currentView === "design") { | 33 | // } |
34 | // Save a reference of the pi inside the document view to be able to clear | ||
35 | this._currentDocument.model.views.design.propertiesPanel = this; | ||
36 | 34 | ||
35 | /* | ||
36 | else if(this._currentDocument.currentView === "design") { | ||
37 | // Display the default document root PI | 37 | // Display the default document root PI |
38 | this.displayElementProperties(this._currentDocument.model.documentRoot); | 38 | //this.displayElementProperties(this._currentDocument.model.documentRoot); |
39 | // this.displaySelection(this._currentDocument.model.selection); | ||
39 | } | 40 | } |
41 | */ | ||
40 | } | 42 | } |
41 | }, | 43 | }, |
42 | 44 | ||
@@ -181,6 +183,20 @@ exports.Properties = Montage.create(Component, { | |||
181 | } | 183 | } |
182 | }, | 184 | }, |
183 | 185 | ||
186 | displaySelection: { | ||
187 | value: function(selection) { | ||
188 | if(selection.length === 0) { | ||
189 | this.displayElementProperties(this._currentDocument.model.documentRoot); | ||
190 | } else { | ||
191 | if(selection.length === 1) { | ||
192 | this.displayElementProperties(this.application.ninja.selectedElements[0]); | ||
193 | } else { | ||
194 | this.displayGroupProperties(this.application.ninja.selectedElements); | ||
195 | } | ||
196 | } | ||
197 | } | ||
198 | }, | ||
199 | |||
184 | clear: { | 200 | clear: { |
185 | value: function() { | 201 | value: function() { |
186 | this.elementName.value = ""; | 202 | this.elementName.value = ""; |
diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js index 49907c9d..104d474d 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js | |||
@@ -213,7 +213,7 @@ exports.ThreeD = Montage.create(Component, { | |||
213 | 213 | ||
214 | this._currentDocument = value; | 214 | this._currentDocument = value; |
215 | 215 | ||
216 | if(this._currentDocument.currentView === "design") { | 216 | if(this._currentDocument && this._currentDocument.currentView === "design") { |
217 | // Save a reference of the pi inside the document view to be able to clear | 217 | // Save a reference of the pi inside the document view to be able to clear |
218 | Object.defineBinding(this, "item", { | 218 | Object.defineBinding(this, "item", { |
219 | boundObject: this, | 219 | boundObject: this, |