diff options
Diffstat (limited to 'js/panels/css-panel/style-sheet.reel')
-rw-r--r-- | js/panels/css-panel/style-sheet.reel/style-sheet.css | 4 | ||||
-rw-r--r-- | js/panels/css-panel/style-sheet.reel/style-sheet.html | 1 | ||||
-rw-r--r-- | js/panels/css-panel/style-sheet.reel/style-sheet.js | 29 |
3 files changed, 34 insertions, 0 deletions
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.css b/js/panels/css-panel/style-sheet.reel/style-sheet.css index 9ea03be8..1d26b041 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.css +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.css | |||
@@ -127,6 +127,10 @@ | |||
127 | margin-right: 25px; | 127 | margin-right: 25px; |
128 | } | 128 | } |
129 | 129 | ||
130 | .default-style-sheet > span { | ||
131 | font-weight: bold; | ||
132 | } | ||
133 | |||
130 | .ss-invisible { | 134 | .ss-invisible { |
131 | display: none; | 135 | display: none; |
132 | } \ No newline at end of file | 136 | } \ No newline at end of file |
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html index 6a9dee65..ca24487d 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.html +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html | |||
@@ -29,6 +29,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
29 | "name": "DynamicText", | 29 | "name": "DynamicText", |
30 | "properties": { | 30 | "properties": { |
31 | "element": {"#": "sheet-name"}, | 31 | "element": {"#": "sheet-name"}, |
32 | "identifier": "nameText", | ||
32 | "defaultText": "Style sheet" | 33 | "defaultText": "Style sheet" |
33 | }, | 34 | }, |
34 | "bindings": { | 35 | "bindings": { |
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 | }, |