Show More
@@ -122,8 +122,7 b' define([' | |||||
122 | .removeClass('widget-hslider') |
|
122 | .removeClass('widget-hslider') | |
123 | .addClass('widget-vslider'); |
|
123 | .addClass('widget-vslider'); | |
124 | this.$el |
|
124 | this.$el | |
125 | .removeClass('widget-hbox-single') |
|
125 | .removeClass('widget-hbox-single'); | |
126 | .addClass('widget-vbox-single'); |
|
|||
127 | this.$label |
|
126 | this.$label | |
128 | .removeClass('widget-hlabel') |
|
127 | .removeClass('widget-hlabel') | |
129 | .addClass('widget-vlabel'); |
|
128 | .addClass('widget-vlabel'); | |
@@ -136,7 +135,6 b' define([' | |||||
136 | .removeClass('widget-vslider') |
|
135 | .removeClass('widget-vslider') | |
137 | .addClass('widget-hslider'); |
|
136 | .addClass('widget-hslider'); | |
138 | this.$el |
|
137 | this.$el | |
139 | .removeClass('widget-vbox-single') |
|
|||
140 | .addClass('widget-hbox-single'); |
|
138 | .addClass('widget-hbox-single'); | |
141 | this.$label |
|
139 | this.$label | |
142 | .removeClass('widget-vlabel') |
|
140 | .removeClass('widget-vlabel') |
@@ -102,20 +102,16 b' define([' | |||||
102 | this.$droplabel.css(name, value); |
|
102 | this.$droplabel.css(name, value); | |
103 | this.$dropbutton.css(name, value); |
|
103 | this.$dropbutton.css(name, value); | |
104 | this.$droplist.css(name, value); |
|
104 | this.$droplist.css(name, value); | |
105 | } if (name.substring(0, 4) == 'font') { |
|
|||
106 | this.$droplabel.css(name, value); |
|
|||
107 | this.$droplist.css(name, value); |
|
|||
108 | } else if (name == 'width') { |
|
105 | } else if (name == 'width') { | |
109 | this.$buttongroup.width(value); |
|
|||
110 | var width = value - this.$dropbutton.width(); |
|
106 | var width = value - this.$dropbutton.width(); | |
111 | this.$droplist.css(name, width); |
|
107 | this.$droplist.css(name, width); | |
112 | this.$droplabel.css(name, width); |
|
108 | this.$droplabel.css(name, width); | |
113 | } else if (name == 'height') { |
|
109 | } else if (name == 'height') { | |
114 |
this.$dropl |
|
110 | this.$droplabel.css(name, value); | |
115 | this.$dropbutton.css(name, value); |
|
111 | this.$dropbutton.css(name, value); | |
116 | } else { |
|
112 | } else { | |
117 | this.$droplabel.css(name, value); |
|
|||
118 | this.$droplist.css(name, value); |
|
113 | this.$droplist.css(name, value); | |
|
114 | this.$droplabel.css(name, value); | |||
119 | } |
|
115 | } | |
120 | }, |
|
116 | }, | |
121 |
|
117 | |||
@@ -209,6 +205,11 b' define([' | |||||
209 | return RadioButtonsView.__super__.update.apply(this); |
|
205 | return RadioButtonsView.__super__.update.apply(this); | |
210 | }, |
|
206 | }, | |
211 |
|
207 | |||
|
208 | update_attr: function(name, value) { | |||
|
209 | // Set a css attr of the widget view. | |||
|
210 | this.$container.css(name, value); | |||
|
211 | }, | |||
|
212 | ||||
212 | handle_click: function (e) { |
|
213 | handle_click: function (e) { | |
213 | // Handle when a value is clicked. |
|
214 | // Handle when a value is clicked. | |
214 |
|
215 | |||
@@ -221,7 +222,12 b' define([' | |||||
221 |
|
222 | |||
222 |
|
223 | |||
223 | var ToggleButtonsView = widget.DOMWidgetView.extend({ |
|
224 | var ToggleButtonsView = widget.DOMWidgetView.extend({ | |
224 |
|
|
225 | initialize: function() { | |
|
226 | this._css_state = {}; | |||
|
227 | ToggleButtonsView.__super__.initialize.apply(this, arguments); | |||
|
228 | }, | |||
|
229 | ||||
|
230 | render: function() { | |||
225 | // Called when view is rendered. |
|
231 | // Called when view is rendered. | |
226 | this.$el |
|
232 | this.$el | |
227 | .addClass('widget-hbox-single'); |
|
233 | .addClass('widget-hbox-single'); | |
@@ -263,6 +269,7 b' define([' | |||||
263 | .appendTo(that.$buttongroup) |
|
269 | .appendTo(that.$buttongroup) | |
264 | .attr('data-value', item) |
|
270 | .attr('data-value', item) | |
265 | .on('click', $.proxy(that.handle_click, that)); |
|
271 | .on('click', $.proxy(that.handle_click, that)); | |
|
272 | that._update_button_style($item_element); | |||
266 | } |
|
273 | } | |
267 | if (that.model.get('value_name') == item) { |
|
274 | if (that.model.get('value_name') == item) { | |
268 | $item_element.addClass('active'); |
|
275 | $item_element.addClass('active'); | |
@@ -300,6 +307,26 b' define([' | |||||
300 | return ToggleButtonsView.__super__.update.apply(this); |
|
307 | return ToggleButtonsView.__super__.update.apply(this); | |
301 | }, |
|
308 | }, | |
302 |
|
309 | |||
|
310 | update_attr: function(name, value) { | |||
|
311 | // Set a css attr of the widget view. | |||
|
312 | this._css_state[name] = value; | |||
|
313 | this._update_button_style(); | |||
|
314 | }, | |||
|
315 | ||||
|
316 | _update_button_style: function(button) { | |||
|
317 | for (var name in this._css_state) { | |||
|
318 | if (this._css_state.hasOwnProperty(name) && name != 'width') { | |||
|
319 | if (button) { | |||
|
320 | button.css(name, this._css_state[name]); | |||
|
321 | } else { | |||
|
322 | this.$buttongroup.find('button').each(function(i, obj) { | |||
|
323 | $(obj).css(name, this._css_state[name]); | |||
|
324 | }); | |||
|
325 | } | |||
|
326 | } | |||
|
327 | } | |||
|
328 | }, | |||
|
329 | ||||
303 | handle_click: function (e) { |
|
330 | handle_click: function (e) { | |
304 | // Handle when a value is clicked. |
|
331 | // Handle when a value is clicked. | |
305 |
|
332 | |||
@@ -382,6 +409,11 b' define([' | |||||
382 | return SelectView.__super__.update.apply(this); |
|
409 | return SelectView.__super__.update.apply(this); | |
383 | }, |
|
410 | }, | |
384 |
|
411 | |||
|
412 | update_attr: function(name, value) { | |||
|
413 | // Set a css attr of the widget view. | |||
|
414 | this.$listbox.css(name, value); | |||
|
415 | }, | |||
|
416 | ||||
385 | handle_click: function (e) { |
|
417 | handle_click: function (e) { | |
386 | // Handle when a value is clicked. |
|
418 | // Handle when a value is clicked. | |
387 |
|
419 |
@@ -152,6 +152,11 b' define([' | |||||
152 | }, this); |
|
152 | }, this); | |
153 | }, |
|
153 | }, | |
154 |
|
154 | |||
|
155 | update_attr: function(name, value) { | |||
|
156 | // Set a css attr of the widget view. | |||
|
157 | this.$tabs.css(name, value); | |||
|
158 | }, | |||
|
159 | ||||
155 | update_children: function(old_list, new_list) { |
|
160 | update_children: function(old_list, new_list) { | |
156 | // Called when the children list is modified. |
|
161 | // Called when the children list is modified. | |
157 | this.do_diff(old_list, |
|
162 | this.do_diff(old_list, |
@@ -107,6 +107,11 b' define([' | |||||
107 | } |
|
107 | } | |
108 | return TextareaView.__super__.update.apply(this); |
|
108 | return TextareaView.__super__.update.apply(this); | |
109 | }, |
|
109 | }, | |
|
110 | ||||
|
111 | update_attr: function(name, value) { | |||
|
112 | // Set a css attr of the widget view. | |||
|
113 | this.$textbox.css(name, value); | |||
|
114 | }, | |||
110 |
|
115 | |||
111 | events: { |
|
116 | events: { | |
112 | // Dictionary of events and their handlers. |
|
117 | // Dictionary of events and their handlers. | |
@@ -178,6 +183,11 b' define([' | |||||
178 | } |
|
183 | } | |
179 | return TextView.__super__.update.apply(this); |
|
184 | return TextView.__super__.update.apply(this); | |
180 | }, |
|
185 | }, | |
|
186 | ||||
|
187 | update_attr: function(name, value) { | |||
|
188 | // Set a css attr of the widget view. | |||
|
189 | this.$textbox.css(name, value); | |||
|
190 | }, | |||
181 |
|
191 | |||
182 | events: { |
|
192 | events: { | |
183 | // Dictionary of events and their handlers. |
|
193 | // Dictionary of events and their handlers. |
@@ -211,6 +211,10 b'' | |||||
211 | min-width : 125px; |
|
211 | min-width : 125px; | |
212 | } |
|
212 | } | |
213 |
|
213 | |||
|
214 | .widget_item .dropdown-menu li a { | |||
|
215 | color: inherit; | |||
|
216 | } | |||
|
217 | ||||
214 | .widget-box { |
|
218 | .widget-box { | |
215 | /* The following section sets the style for the invisible div that |
|
219 | /* The following section sets the style for the invisible div that | |
216 | hold widgets and their accompanying labels. |
|
220 | hold widgets and their accompanying labels. | |
@@ -238,7 +242,6 b'' | |||||
238 | .widget-hbox-single { |
|
242 | .widget-hbox-single { | |
239 | /* Single line horizontal widgets */ |
|
243 | /* Single line horizontal widgets */ | |
240 | .widget-hbox(); |
|
244 | .widget-hbox(); | |
241 | height : 30px; |
|
|||
242 |
|
245 | |||
243 | input[type="checkbox"] { |
|
246 | input[type="checkbox"] { | |
244 | margin-top: 9px; |
|
247 | margin-top: 9px; | |
@@ -251,12 +254,6 b'' | |||||
251 | .vbox(); |
|
254 | .vbox(); | |
252 | } |
|
255 | } | |
253 |
|
256 | |||
254 | .widget-vbox-single { |
|
|||
255 | /* For vertical slides */ |
|
|||
256 | .widget-vbox(); |
|
|||
257 | width : 30px; |
|
|||
258 | } |
|
|||
259 |
|
||||
260 | .widget-modal { |
|
257 | .widget-modal { | |
261 | /* Box - ModalView */ |
|
258 | /* Box - ModalView */ | |
262 | overflow : hidden; |
|
259 | overflow : hidden; | |
@@ -296,4 +293,4 b'' | |||||
296 | top: 0px !important; |
|
293 | top: 0px !important; | |
297 | left: 0px !important; |
|
294 | left: 0px !important; | |
298 | margin-left: 0px !important; |
|
295 | margin-left: 0px !important; | |
299 | } No newline at end of file |
|
296 | } |
General Comments 0
You need to be logged in to leave comments.
Login now