Skip to content

Commit d900429

Browse files
author
Chris K
committed
Code style fixes.
1 parent 4263a87 commit d900429

File tree

2 files changed

+31
-30
lines changed

2 files changed

+31
-30
lines changed

src/ui-scripts/cells.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,20 +564,21 @@
564564
{
565565
var dim = this.dir == VER ? 'height' : 'width';
566566
var max = this[dim];
567-
var child = null, i = 0, sum = 0, length = this.children.length, temp = 0, min = 0;
568-
var auto_dim_count = 0, average_dim = 0;
567+
var length = this.children.length;
568+
var auto_dim_count = 0;
569+
var average_dim = 0;
569570
if (length)
570571
{
571572
// check how many implicit (auto) dimensions were specified
572-
for (i = 0; child = this.children[i++]; )
573+
for (var i = 0, child; child = this.children[i++]; )
573574
{
574575
if (!child['has_explicit_' + dim])
575576
auto_dim_count++;
576577
}
577578

578579
if (auto_dim_count)
579580
{
580-
sum = this.get_total_children_dimension(dim, true);
581+
var sum = this.get_total_children_dimension(dim, true);
581582
if (sum < max)
582583
{
583584
// calculate average that should be allocated for each auto dimension
@@ -586,7 +587,7 @@
586587
// allocate space
587588
for (i = 0; child = this.children[i++]; )
588589
{
589-
min = child['min_' + dim];
590+
var min = child['min_' + dim];
590591
if (child['has_explicit_' + dim] && child[dim] < min)
591592
{
592593
// if the dimension is below the minimum limit, set minimum value
@@ -603,7 +604,7 @@
603604
while (--length)
604605
{
605606
sum = this.get_total_children_dimension(dim);
606-
temp = max - (sum - this.children[length][dim] - 2 * defaults.view_border_width);
607+
var temp = max - (sum - this.children[length][dim] - 2 * defaults.view_border_width);
607608
min = this.children[length]['min_' + dim];
608609
if (sum <= max || min < temp)
609610
{

src/ui-scripts/ui-actions.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ new EventHandler('scroll', true);
8888

8989
/***** general ui click handler *****/
9090

91-
window.eventHandlers.mousedown['tab'] = function(event, target)
91+
window.event_handlers.mousedown['tab'] = function(event, target)
9292
{
9393
var tabs = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
9494
var view_id = target.get_attr('parent-node-chain', 'ref-id');
@@ -99,11 +99,11 @@ window.eventHandlers.mousedown['tab'] = function(event, target)
9999
else
100100
{
101101
opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
102-
"tabs is missing in window.eventHandlers.click['tab'] in ui-actions");
102+
"tabs is missing in window.event_handlers.click['tab'] in ui-actions");
103103
}
104104
}
105105

106-
window.eventHandlers.mousewheel['change-on-scroll'] = function(event, target)
106+
window.event_handlers.mousewheel['change-on-scroll'] = function(event, target)
107107
{
108108
if (target.nodeName == "tab")
109109
{
@@ -113,18 +113,18 @@ window.eventHandlers.mousewheel['change-on-scroll'] = function(event, target)
113113
if (event.detail < 0) {
114114
if (active_tab.previousElementSibling)
115115
{
116-
window.eventHandlers.mousedown['tab'](null, active_tab.previousElementSibling);
116+
window.event_handlers.mousedown['tab'](null, active_tab.previousElementSibling);
117117
}
118118
}
119119
else {
120120
if (active_tab.nextElementSibling)
121121
{
122-
window.eventHandlers.mousedown['tab'](null, active_tab.nextElementSibling);
122+
window.event_handlers.mousedown['tab'](null, active_tab.nextElementSibling);
123123
}
124124
}
125125
}
126126

127-
window.eventHandlers.click['close-tab'] = function(event, target)
127+
window.event_handlers.click['close-tab'] = function(event, target)
128128
{
129129
//target = target.parentElement;
130130

@@ -137,15 +137,15 @@ window.eventHandlers.click['close-tab'] = function(event, target)
137137
}
138138
}
139139

140-
window.eventHandlers.mousedown['horizontal-nav'] = function(event, target)
140+
window.event_handlers.mousedown['horizontal-nav'] = function(event, target)
141141
{
142142
var horizontal_nav = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
143143
var dir = target.get_attr('parent-node-chain', 'dir');
144144
horizontal_nav.nav(dir, true);
145145
};
146146

147-
window.eventHandlers.mouseup['horizontal-nav'] =
148-
window.eventHandlers.mouseout['horizontal-nav'] = function(event, target)
147+
window.event_handlers.mouseup['horizontal-nav'] =
148+
window.event_handlers.mouseout['horizontal-nav'] = function(event, target)
149149
{
150150
var selection = window.getSelection();
151151
if (!selection.isCollapsed)
@@ -156,26 +156,26 @@ window.eventHandlers.mouseout['horizontal-nav'] = function(event, target)
156156
horizontal_nav.clear_nav_timeout();
157157
};
158158

159-
window.eventHandlers.mousewheel['breadcrumbs-drag'] = function(event, target)
159+
window.event_handlers.mousewheel['breadcrumbs-drag'] = function(event, target)
160160
{
161161
var horizontal_nav = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
162162
horizontal_nav.nav(event.detail < 0 ? 100 : -100);
163163
};
164164

165-
window.eventHandlers.mousedown['breadcrumbs-drag'] = function(event, target)
165+
window.event_handlers.mousedown['breadcrumbs-drag'] = function(event, target)
166166
{
167167
var horizontal_nav = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
168168
horizontal_nav.drag_breadcrumb(event, target);
169169

170170
};
171171

172-
window.eventHandlers.click['settings-tabs'] = function(event, target)
172+
window.event_handlers.click['settings-tabs'] = function(event, target)
173173
{
174174
var tabs = UIBase.getUIById(target.parentElement.getAttribute('ui-id'));
175175
windows.showWindow('window-3', 'Settings', templates.settings(tabs), 200, 200, 200, 200);
176176
}
177177

178-
window.eventHandlers.click['show-search'] = function(event, target)
178+
window.event_handlers.click['show-search'] = function(event, target)
179179
{
180180
var toolbar = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
181181
if (toolbar)
@@ -188,38 +188,38 @@ window.eventHandlers.click['show-search'] = function(event, target)
188188
}
189189
}
190190

191-
window.eventHandlers.click['show-window'] = function(event)
191+
window.event_handlers.click['show-window'] = function(event)
192192
{
193193
var target = event.target;
194194
var view_id = target.getAttribute('view-id');
195195
target.parentNode.parentNode.parentNode.removeChild(target.parentNode.parentNode);
196196
UIWindowBase.showWindow(view_id);
197197
}
198198

199-
window.eventHandlers.click['documentation'] = function(event)
199+
window.event_handlers.click['documentation'] = function(event)
200200
{
201201
window.open(event.target.getAttribute('param'), '_info_window').focus();
202202
}
203203

204204

205-
window.eventHandlers.click['top-window-close'] = function(event)
205+
window.event_handlers.click['top-window-close'] = function(event)
206206
{
207207
window.close();
208208
}
209209

210-
window.eventHandlers.click['top-window-toggle-attach'] = function(event)
210+
window.event_handlers.click['top-window-toggle-attach'] = function(event)
211211
{
212212
window.opera.attached = !window.opera.attached;
213213
window.settings.general.set('window-attached', window.opera.attached);
214214
window.client.create_window_controls();
215215
}
216216

217-
window.eventHandlers.click['overlay-tab'] = function(event, target)
217+
window.event_handlers.click['overlay-tab'] = function(event, target)
218218
{
219219
Overlay.get_instance().change_group(event.target.getAttribute("group"));
220220
};
221221

222-
window.eventHandlers.click['toggle-overlay'] = function(event, target)
222+
window.event_handlers.click['toggle-overlay'] = function(event, target)
223223
{
224224
var overlay = Overlay.get_instance();
225225
var overlay_id = target.getAttribute("data-overlay-id");
@@ -229,12 +229,12 @@ window.eventHandlers.click['toggle-overlay'] = function(event, target)
229229
this.broker.dispatch_action("global", "show-overlay", event, target);
230230
};
231231

232-
window.eventHandlers.click['toggle-console'] = function(event, target)
232+
window.event_handlers.click['toggle-console'] = function(event, target)
233233
{
234234
this.broker.dispatch_action("global", "toggle-console", event, target);
235235
};
236236

237-
window.eventHandlers.click['toolbar-switch'] = function(event)
237+
window.event_handlers.click['toolbar-switch'] = function(event)
238238
{
239239
var target = event.target;
240240
var arr = target.getAttribute('key') && target.getAttribute('key').split('.');
@@ -249,7 +249,7 @@ window.eventHandlers.click['toolbar-switch'] = function(event)
249249
}
250250
}
251251

252-
window.eventHandlers.click["toolbar-single-select"] = function(event, target)
252+
window.event_handlers.click["toolbar-single-select"] = function(event, target)
253253
{
254254
var button = event.target;
255255
var view_id = target.getAttribute("data-view-id");
@@ -302,7 +302,7 @@ window.eventHandlers.click["toolbar-single-select"] = function(event, target)
302302
}
303303
}
304304

305-
window.eventHandlers.click["close-overlay-view"] = function(event, target)
305+
window.event_handlers.click["close-overlay-view"] = function(event, target)
306306
{
307307
var ui_id = target.get_ancestor_attr("ui-id");
308308
var toolbar = UIBase.getUIById(ui_id);
@@ -314,7 +314,7 @@ window.eventHandlers.click["close-overlay-view"] = function(event, target)
314314

315315
/***** change handler *****/
316316

317-
window.eventHandlers.change['checkbox-setting'] = function(event)
317+
window.event_handlers.change['checkbox-setting'] = function(event)
318318
{
319319
var ele = event.target;
320320
var view_id = ele.getAttribute('view-id');

0 commit comments

Comments
 (0)