aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Guzman2012-05-27 17:19:07 -0700
committerEric Guzman2012-05-27 17:19:07 -0700
commitf277cbad9bbfc077fc37546758b85408419951f2 (patch)
tree80615314dc5ecb371989663411f5781d4279c10d
parenta00e1f30c3da3053574c982ddfacca12e32c12b2 (diff)
downloadninja-f277cbad9bbfc077fc37546758b85408419951f2.tar.gz
CSS Panel - Prevent Animation on New Style
-rw-r--r--js/panels/css-panel/style-declaration.reel/style-declaration.css3
-rw-r--r--js/panels/css-panel/style-declaration.reel/style-declaration.js10
-rw-r--r--js/panels/css-panel/styles-view-delegate.js2
3 files changed, 13 insertions, 2 deletions
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 5229b92e..d607a0ba 100644
--- a/js/panels/css-panel/styles-view-delegate.js
+++ b/js/panels/css-panel/styles-view-delegate.js
@@ -145,7 +145,7 @@ exports.StylesViewDelegate = Montage.create(Component, {
145 if(nextFocus) { 145 if(nextFocus) {
146 nextFocus.propertyField.start(); 146 nextFocus.propertyField.start();
147 } else if(style.dirty) { 147 } else if(style.dirty) {
148 style.parentComponent.parentComponent.addNewStyle(); 148 style.parentComponent.parentComponent.addNewStyle(true);
149 style.editingNewStyle = false; 149 style.editingNewStyle = false;
150 setTimeout(function() { 150 setTimeout(function() {
151 style.getSiblingStyle('next').propertyField.start(); 151 style.getSiblingStyle('next').propertyField.start();