aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Components/ComponentsPanelBase.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Components/ComponentsPanelBase.reel')
-rw-r--r--js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js33
1 files changed, 12 insertions, 21 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index c8624b29..58a798d8 100644
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -27,18 +27,6 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
27 this.eventManager.addEventListener( "executeAddComponent", this, false); 27 this.eventManager.addEventListener( "executeAddComponent", this, false);
28 } 28 }
29 }, 29 },
30 willDraw: {
31 enumerable: false,
32 value: function() {
33
34 }
35 },
36 draw: {
37 enumerable: false,
38 value: function() {
39
40 }
41 },
42 30
43 _loadXMLDoc: { 31 _loadXMLDoc: {
44 value:function(dname) { 32 value:function(dname) {
@@ -61,18 +49,17 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
61 value:function(componentType, dropX, dropY){ 49 value:function(componentType, dropX, dropY){
62// var compW = 100, 50// var compW = 100,
63// compH = 100, 51// compH = 100,
64// elementType = "div", 52//
65// componentContainer, 53 var componentEl, componentInstance;
66// componentElement;
67 var componentEl;
68 54
69 if(componentType == "Button"){ 55 if(componentType == "Button"){
70 componentEl = NJUtils.makeNJElement("button", componentType, "component");//, {"type": "button"}); 56 componentEl = NJUtils.makeNJElement("button", componentType, "component");//, {"type": "button"});
71 componentEl.setAttribute("type", "button"); 57 componentEl.setAttribute("type", "button");
72 componentEl.innerHTML = "Button"; 58 //componentEl.innerHTML = "Button";
73 console.log(componentEl); 59
74// compW = 118; 60 componentInstance = this.application.ninja.currentDocument._window.addComponent(componentEl, {type: componentType, path: "montage/ui/button.reel", name: "Button"});
75// compH = 52; 61
62
76 }else if(componentType == "Checkbox"){ 63 }else if(componentType == "Checkbox"){
77 compW = 53; 64 compW = 53;
78 compH = 53; 65 compH = 53;
@@ -142,12 +129,16 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
142 129
143 //componentContainer.appendChild(componentElement); 130 //componentContainer.appendChild(componentElement);
144 131
132 this.application.ninja.currentDocument.setComponentInstance(componentInstance, componentEl);
133
145 NJevent("elementAdding", {"el": componentEl, "data":styles}); 134 NJevent("elementAdding", {"el": componentEl, "data":styles});
146 /* 135 /*
147 var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType); 136 var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType);
148 this.application.ninja.currentDocument._userComponentSet[componentContainer.uuid] = componentRef; 137
149 */ 138 */
150 139
140
141
151 } 142 }
152 } 143 }
153}); \ No newline at end of file 144}); \ No newline at end of file