aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-sheet.reel/style-sheet.js
diff options
context:
space:
mode:
authorEric Guzman2012-05-08 09:43:57 -0700
committerEric Guzman2012-05-08 09:43:57 -0700
commitaf4dac82d2e76fe90191d6c085740d855bf961f3 (patch)
treebe1eb3c1cab11bc8711f92c6a47a3fa6c46c07e7 /js/panels/css-panel/style-sheet.reel/style-sheet.js
parenta62f57cf6beee332ff60a48f5e26d0084b4a5432 (diff)
downloadninja-af4dac82d2e76fe90191d6c085740d855bf961f3.tar.gz
Style sheets - Added default stylesheet selection
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.js29
1 files changed, 29 insertions, 0 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 9ad48a62..3ddd8454 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -12,6 +12,12 @@ exports.StyleSheet = Montage.create(Component, {
12 value: null 12 value: null
13 }, 13 },
14 14
15 prepareForDraw : {
16 value: function() {
17 this.nameText.element.addEventListener('click', this, false);
18 }
19 },
20
15 willDraw : { 21 willDraw : {
16 value: function() { 22 value: function() {
17 if(this.editing) { 23 if(this.editing) {
@@ -45,6 +51,12 @@ exports.StyleSheet = Montage.create(Component, {
45 this.importButton.element.classList.add('ss-invisible'); 51 this.importButton.element.classList.add('ss-invisible');
46 } 52 }
47 53
54 if(this.default) {
55 this._element.classList.add('default-style-sheet');
56 } else {
57 this._element.classList.remove('default-style-sheet');
58 }
59
48 } 60 }
49 }, 61 },
50 62
@@ -66,6 +78,12 @@ exports.StyleSheet = Montage.create(Component, {
66 } 78 }
67 }, 79 },
68 80
81 handleClick : {
82 value: function(e) {
83 this.parentComponent.parentComponent.defaultStyleSheet = this.source;
84 }
85 },
86
69 handleEditButtonAction: { 87 handleEditButtonAction: {
70 value: function(e) { 88 value: function(e) {
71 this.editing = true; 89 this.editing = true;
@@ -130,6 +148,17 @@ exports.StyleSheet = Montage.create(Component, {
130 } 148 }
131 }, 149 },
132 150
151 _default : { value: null },
152 default : {
153 get: function() {
154 return this._default;
155 },
156 set: function(value) {
157 this._default = value;
158 this.needsDraw = true;
159 }
160 },
161
133 _disabled : { 162 _disabled : {
134 value: null 163 value: null
135 }, 164 },