diff options
author | Eric Guzman | 2012-03-12 15:29:37 -0700 |
---|---|---|
committer | Eric Guzman | 2012-03-12 15:29:37 -0700 |
commit | 7a28932ba8a7517bbaaabe1f5edf678416aafc9c (patch) | |
tree | fa1cb39de4a3bf9bc3a5a7c5db043e55cee64975 /js/panels/css-panel/style-shorthand.reel/style-shorthand.js | |
parent | ec862af55e5c3d564b37eac2744a1a6815f81f4d (diff) | |
download | ninja-7a28932ba8a7517bbaaabe1f5edf678416aafc9c.tar.gz |
CSS Panel - Adding declaration, style (tree leaf), and style shorthand (tree branch) components
Diffstat (limited to 'js/panels/css-panel/style-shorthand.reel/style-shorthand.js')
-rw-r--r-- | js/panels/css-panel/style-shorthand.reel/style-shorthand.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.js b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js new file mode 100644 index 00000000..00749faa --- /dev/null +++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js | |||
@@ -0,0 +1,56 @@ | |||
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").Montage, | ||
8 | TreeNode = require("js/components/treeview/tree-node").TreeNode; | ||
9 | |||
10 | var styleShorthand = exports.StyleShorthand= Montage.create(TreeNode, { | ||
11 | repetition: { value: null }, | ||
12 | propertyText : { value: "property" }, | ||
13 | valueText : { value: "value" }, | ||
14 | |||
15 | handleSourceObjectSet: { | ||
16 | value: function() { | ||
17 | this.propertyText = this.sourceObject.name; | ||
18 | this.valueText = this.sourceObject.value; | ||
19 | } | ||
20 | }, | ||
21 | prepareForDraw : { | ||
22 | value: function() { | ||
23 | this.styleListDisclosure.addEventListener('click', this, false); | ||
24 | this.treeView.contentController.addBranchController(this.arrayController); | ||
25 | } | ||
26 | }, | ||
27 | templateDidLoad: { | ||
28 | value: function() { | ||
29 | this.arrayController.delegate = this.treeView.contentController; | ||
30 | } | ||
31 | }, | ||
32 | willDraw : { | ||
33 | value: function() { | ||
34 | |||
35 | } | ||
36 | }, | ||
37 | draw:{ | ||
38 | value: function () { | ||
39 | |||
40 | console.log("style shorthand - draw"); | ||
41 | shorthand = this; | ||
42 | if (this.sourceObject[this.labelKey]) { | ||
43 | this._labelText = this.sourceObject[this.labelKey]; | ||
44 | } | ||
45 | |||
46 | } | ||
47 | }, | ||
48 | |||
49 | handleClick : { | ||
50 | value: function(e) { | ||
51 | e.preventDefault(); | ||
52 | this.toggleExpand(); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | }); | ||