diff options
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Components/Components.xml | 22 | ||||
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 36 |
2 files changed, 22 insertions, 36 deletions
diff --git a/js/panels/Components/Components.xml b/js/panels/Components/Components.xml index b3056330..e076602e 100644 --- a/js/panels/Components/Components.xml +++ b/js/panels/Components/Components.xml | |||
@@ -2,27 +2,5 @@ | |||
2 | <tree id="Components"> | 2 | <tree id="Components"> |
3 | <folder id="montageComponents" label="Montage Components"> | 3 | <folder id="montageComponents" label="Montage Components"> |
4 | <leaf id="Button" label="Button" /> | 4 | <leaf id="Button" label="Button" /> |
5 | <leaf id="Checkbox" label="Checkbox" /> | ||
6 | <leaf id="DynamicText" label="Dynamic Text" /> | ||
7 | <leaf id="FlowController" label="FlowController" /> | ||
8 | <leaf id="HotText" label="HotText" /> | ||
9 | <leaf id="HotTextUnit" label="HotTextUnit" /> | ||
10 | <leaf id="ImageContainer" label="Image Container" /> | ||
11 | <leaf id="Progress" label="Progress" /> | ||
12 | <leaf id="Scrollview" label="Scrollview" /> | ||
13 | <leaf id="Slider" label="Slider" /> | ||
14 | <leaf id="TextArea" label="TextArea" /> | ||
15 | <leaf id="Textfield" label="Textfield" /> | ||
16 | <leaf id="Toggle" label="Toggle" /> | ||
17 | </folder> | ||
18 | <folder id="metaComponents" label="Meta Components"> | ||
19 | <leaf id="Condition" label="Condition" /> | ||
20 | <leaf id="Repetition" label="Repetition" /> | ||
21 | <leaf id="Slot" label="Slot" /> | ||
22 | <leaf id="Substitution" label="Substitution" /> | ||
23 | </folder> | ||
24 | <folder id="htmlPresets" label="HTML Components"> | ||
25 | <leaf id="html_button" label="Button" /> | ||
26 | <leaf id="html_input" label="Text Input" /> | ||
27 | </folder> | 5 | </folder> |
28 | </tree> \ No newline at end of file | 6 | </tree> \ No newline at end of file |
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index 41afefa5..c8624b29 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -59,15 +59,20 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
59 | 59 | ||
60 | addComponentToStage:{ | 60 | addComponentToStage:{ |
61 | value:function(componentType, dropX, dropY){ | 61 | value:function(componentType, dropX, dropY){ |
62 | var compW = 100, | 62 | // var compW = 100, |
63 | compH = 100, | 63 | // compH = 100, |
64 | elementType = "div", | 64 | // elementType = "div", |
65 | componentContainer, | 65 | // componentContainer, |
66 | componentElement; | 66 | // componentElement; |
67 | var componentEl; | ||
67 | 68 | ||
68 | if(componentType == "Button"){ | 69 | if(componentType == "Button"){ |
69 | compW = 118; | 70 | componentEl = NJUtils.makeNJElement("button", componentType, "component");//, {"type": "button"}); |
70 | compH = 52; | 71 | componentEl.setAttribute("type", "button"); |
72 | componentEl.innerHTML = "Button"; | ||
73 | console.log(componentEl); | ||
74 | // compW = 118; | ||
75 | // compH = 52; | ||
71 | }else if(componentType == "Checkbox"){ | 76 | }else if(componentType == "Checkbox"){ |
72 | compW = 53; | 77 | compW = 53; |
73 | compH = 53; | 78 | compH = 53; |
@@ -117,28 +122,31 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
117 | compH = 25; | 122 | compH = 25; |
118 | } | 123 | } |
119 | 124 | ||
125 | |||
126 | /* | ||
120 | componentContainer = NJUtils.makeNJElement("div", componentType, "component"); | 127 | componentContainer = NJUtils.makeNJElement("div", componentType, "component"); |
121 | componentContainer.elementModel.isComponent = true; | 128 | componentContainer.elementModel.isComponent = true; |
122 | 129 | */ | |
123 | var styles = { | 130 | var styles = { |
124 | 'position': 'absolute', | 131 | 'position': 'absolute', |
125 | 'top' : dropY + 'px', | 132 | 'top' : dropY + 'px', |
126 | 'left' : dropX + 'px', | 133 | 'left' : dropX + 'px', |
127 | 'width' : compW + 'px', | 134 | // 'width' : compW + 'px', |
128 | 'height' : compH + 'px', | 135 | // 'height' : compH + 'px', |
129 | '-webkit-transform-style' : 'preserve-3d', | 136 | '-webkit-transform-style' : 'preserve-3d', |
130 | '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' | 137 | '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' |
131 | }; | 138 | }; |
132 | 139 | ||
133 | 140 | ||
134 | componentElement = NJUtils.makeNJElement(elementType, "ComponentDiv", "block"); | 141 | //componentElement = NJUtils.makeNJElement(elementType, "ComponentDiv", "block"); |
135 | |||
136 | componentContainer.appendChild(componentElement); | ||
137 | 142 | ||
138 | NJevent("elementAdding", {"el": componentContainer, "data":styles}); | 143 | //componentContainer.appendChild(componentElement); |
139 | 144 | ||
145 | NJevent("elementAdding", {"el": componentEl, "data":styles}); | ||
146 | /* | ||
140 | var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType); | 147 | var componentRef = this.application.ninja.currentDocument._window.addComponent(componentElement, componentType); |
141 | this.application.ninja.currentDocument._userComponentSet[componentContainer.uuid] = componentRef; | 148 | this.application.ninja.currentDocument._userComponentSet[componentContainer.uuid] = componentRef; |
149 | */ | ||
142 | 150 | ||
143 | } | 151 | } |
144 | } | 152 | } |