diff options
Diffstat (limited to 'js/panels/css-panel/styles-view-container.reel/styles-view-container.js')
-rw-r--r-- | js/panels/css-panel/styles-view-container.reel/styles-view-container.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js new file mode 100644 index 00000000..0204d2b8 --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js | |||
@@ -0,0 +1,59 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.StylesViewContainer = Montage.create(Component, { | ||
11 | contentController : { | ||
12 | value: null | ||
13 | }, | ||
14 | contentPanel : { | ||
15 | value: 'rules' | ||
16 | }, | ||
17 | _hasStyles : { | ||
18 | value: false | ||
19 | }, | ||
20 | hasStyles : { | ||
21 | get: function() { | ||
22 | return this._hasStyles; | ||
23 | }, | ||
24 | set: function(hasThem) { | ||
25 | this._hasStyles = hasThem; | ||
26 | this.needsDraw = true; | ||
27 | } | ||
28 | }, | ||
29 | templateDidLoad : { | ||
30 | value: function() { | ||
31 | this.eventManager.addEventListener('styleSheetsReady', this, false); | ||
32 | } | ||
33 | }, | ||
34 | handleStyleSheetsReady: { | ||
35 | value: function(e) { | ||
36 | this.eventManager.addEventListener( "selectionChange", this, false); | ||
37 | } | ||
38 | }, | ||
39 | handleSelectionChange: { | ||
40 | value: function() { | ||
41 | var elements = this.application.ninja.selectedElements; | ||
42 | |||
43 | if(elements.length === 0) { return false; } | ||
44 | |||
45 | this.ruleListContainer.displayListForSelection(elements); | ||
46 | this.hasStyles = true; | ||
47 | } | ||
48 | }, | ||
49 | |||
50 | draw : { | ||
51 | value: function() { | ||
52 | if(this.hasStyles) { | ||
53 | this.element.classList.remove('no-styles'); | ||
54 | } else { | ||
55 | this.element.classList.add('no-styles'); | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | }); \ No newline at end of file | ||