From 7a28932ba8a7517bbaaabe1f5edf678416aafc9c Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 12 Mar 2012 15:29:37 -0700 Subject: CSS Panel - Adding declaration, style (tree leaf), and style shorthand (tree branch) components --- .../style-shorthand.reel/style-shorthand.js | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 js/panels/css-panel/style-shorthand.reel/style-shorthand.js (limited to 'js/panels/css-panel/style-shorthand.reel/style-shorthand.js') 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 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage").Montage, + TreeNode = require("js/components/treeview/tree-node").TreeNode; + +var styleShorthand = exports.StyleShorthand= Montage.create(TreeNode, { + repetition: { value: null }, + propertyText : { value: "property" }, + valueText : { value: "value" }, + + handleSourceObjectSet: { + value: function() { + this.propertyText = this.sourceObject.name; + this.valueText = this.sourceObject.value; + } + }, + prepareForDraw : { + value: function() { + this.styleListDisclosure.addEventListener('click', this, false); + this.treeView.contentController.addBranchController(this.arrayController); + } + }, + templateDidLoad: { + value: function() { + this.arrayController.delegate = this.treeView.contentController; + } + }, + willDraw : { + value: function() { + + } + }, + draw:{ + value: function () { + +console.log("style shorthand - draw"); + shorthand = this; + if (this.sourceObject[this.labelKey]) { + this._labelText = this.sourceObject[this.labelKey]; + } + + } + }, + + handleClick : { + value: function(e) { + e.preventDefault(); + this.toggleExpand(); + } + } + +}); -- cgit v1.2.3