From aea46a37ae8038da570fc7cf07ef6e8c0d9ef577 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 30 Apr 2012 13:46:55 -0700 Subject: CSS Style - Add style interaction --- js/panels/css-panel/declaration.reel/declaration.html | 5 +++-- js/panels/css-panel/declaration.reel/declaration.js | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'js/panels/css-panel/declaration.reel') diff --git a/js/panels/css-panel/declaration.reel/declaration.html b/js/panels/css-panel/declaration.reel/declaration.html index 3a513871..3ff41e0c 100644 --- a/js/panels/css-panel/declaration.reel/declaration.html +++ b/js/panels/css-panel/declaration.reel/declaration.html @@ -15,7 +15,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "name" : "Declaration", "properties" : { "element" : {"#" : "container"}, - "treeController": {"@": "treeController"} + "treeController": {"@": "treeController"}, + "treeView" : {"@": "treeView"} } }, "styleShorthand": { @@ -23,7 +24,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "name": "StyleShorthand" }, "treeController": { - "module": "js/controllers/tree-controller", + "module": "js/components/controllers/tree-controller", "name": "TreeController", "properties" : { "branchKey" : "properties", diff --git a/js/panels/css-panel/declaration.reel/declaration.js b/js/panels/css-panel/declaration.reel/declaration.js index 9685510b..873d2ce4 100644 --- a/js/panels/css-panel/declaration.reel/declaration.js +++ b/js/panels/css-panel/declaration.reel/declaration.js @@ -18,7 +18,10 @@ exports.Declaration = Montage.create(Component, { templateDidLoad : { value: function() { console.log("declaration - template did load"); - this.treeController.delegate = this.focusDelegate || this; + + if(this.focusDelegate) { + this.treeController.delegate = this.focusDelegate; + } } }, prepareForDraw : { @@ -119,9 +122,17 @@ exports.Declaration = Montage.create(Component, { distinct: true }, - addNewStyle : { - value: function() { - debugger; + addNewStyleAfter : { + value: function(style) { + //this.treeController.branchControllers[0].addObjects({ + foo1 = style.parentComponent.parentComponent; + style.parentComponent.parentComponent.contentController.addObjects({ + name: 'property', + value: 'value', + isEmpty: true, + treeNodeType: 'leaf' + }); + style.parentComponent.parentComponent.needsDraw = true; } }, -- cgit v1.2.3