aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-sheet.reel/style-sheet.js
diff options
context:
space:
mode:
authorEric Guzman2012-05-18 14:05:06 -0700
committerEric Guzman2012-05-18 14:05:06 -0700
commit197a7646e472fcea616764685c8d03c6063e66f5 (patch)
tree793ef1007234f15958127b3c6f2fb3ff7b7a598b /js/panels/css-panel/style-sheet.reel/style-sheet.js
parent18c260f5f55608d4774aea27f6c2d23e89921361 (diff)
downloadninja-197a7646e472fcea616764685c8d03c6063e66f5.tar.gz
CSS Panel - Add support for deleting style sheets
Diffstat (limited to 'js/panels/css-panel/style-sheet.reel/style-sheet.js')
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js
index 0ff195d5..a3326275 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -11,6 +11,10 @@ exports.StyleSheet = Montage.create(Component, {
11 _translateDistance: { 11 _translateDistance: {
12 value: null 12 value: null
13 }, 13 },
14 viewContainer : {
15 value: null,
16 serializable: true
17 },
14 18
15 prepareForDraw : { 19 prepareForDraw : {
16 value: function() { 20 value: function() {
@@ -43,14 +47,6 @@ exports.StyleSheet = Montage.create(Component, {
43 this.editView.style.removeProperty(transStr); 47 this.editView.style.removeProperty(transStr);
44 } 48 }
45 49
46 if(this._readOnly) {
47 this._element.classList.add('ss-locked');
48 this.importButton.element.classList.remove('ss-invisible');
49 } else {
50 this._element.classList.remove('ss-locked');
51 this.importButton.element.classList.add('ss-invisible');
52 }
53
54 if(this.default) { 50 if(this.default) {
55 this._element.classList.add('default-style-sheet'); 51 this._element.classList.add('default-style-sheet');
56 } else { 52 } else {
@@ -73,10 +69,7 @@ exports.StyleSheet = Montage.create(Component, {
73 var nonBlurringElements = [ 69 var nonBlurringElements = [
74 this.editView, 70 this.editView,
75 this.deleteButton.element, 71 this.deleteButton.element,
76 this.disableButton.element, 72 this.disableButton.element];
77 this.importButton.element];
78
79 console.log("handle mousedown");
80 73
81 if(nonBlurringElements.indexOf(e.target) === -1) { 74 if(nonBlurringElements.indexOf(e.target) === -1) {
82 this.editing = false; 75 this.editing = false;
@@ -112,7 +105,7 @@ exports.StyleSheet = Montage.create(Component, {
112 handleDeleteButtonAction : { 105 handleDeleteButtonAction : {
113 value: function(e) { 106 value: function(e) {
114 e.stopPropagation(); 107 e.stopPropagation();
115 debugger; 108 this.parentComponent.parentComponent.handleDeleteAction(this);
116 } 109 }
117 }, 110 },
118 111
@@ -208,6 +201,8 @@ exports.StyleSheet = Montage.create(Component, {
208 return this._source; 201 return this._source;
209 }, 202 },
210 set: function(sheet) { 203 set: function(sheet) {
204 if(!sheet || sheet === this._source) { return; }
205
211 console.log('sheet being set: ', this); 206 console.log('sheet being set: ', this);
212 207
213 this._extractData(sheet.ownerNode); 208 this._extractData(sheet.ownerNode);