Skip to content

Commit e9965d3

Browse files
author
Christian Krebs
committed
Review fixes.
1 parent e75a4d3 commit e9965d3

File tree

7 files changed

+59
-70
lines changed

7 files changed

+59
-70
lines changed

src/network/network_view.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,6 @@ cls.DetailOverlayView = function(id, container_class, html, default_handler, ser
936936

937937
// overlay view has no name
938938
this.init(id, container_class, html, default_handler);
939-
940939
};
941940

942941
cls.DetailOverlayView.prototype = new OverlayView();

src/ui-scripts/celloverlay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
this._init(view_id, parent_cell, parent_view_id);
44
};
55

6-
CellOverlayPrototype = function()
6+
var CellOverlayPrototype = function()
77
{
88
this._init = function(view_id, parent_cell, parent_view_id)
99
{

src/ui-scripts/cells.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,12 @@
288288
rough_cell.height = stored_height;
289289
}
290290

291-
this.min_width = rough_cell.min_width != null?
292-
rough_cell.min_width : defaults.min_view_width;
293-
this.min_height = rough_cell.min_height != null ?
294-
rough_cell.min_height : defaults.min_view_height;
295-
291+
this.min_width = rough_cell.min_width != null
292+
? rough_cell.min_width
293+
: defaults.min_view_width;
294+
this.min_height = rough_cell.min_height != null
295+
? rough_cell.min_height
296+
: defaults.min_view_height;
296297
this.width =
297298
rough_cell.width && rough_cell.width > this.min_width ?
298299
rough_cell.width : this.min_width;
@@ -693,24 +694,27 @@
693694
this.checkDelta = function(dim, delta, sibling)
694695
{
695696
var delta_applied = 0;
696-
var child = null, i = 0;
697-
var deltas = [], min = 0, max = 0;
698-
if( this.children.length )
697+
var child = null;
698+
var deltas = [];
699+
var i = 0;
700+
var min = 0;
701+
var max = 0;
702+
if (this.children.length)
699703
{
700-
if( ( dim == 'height' && this.dir == HOR ) || ( dim == 'width' && this.dir == VER ) )
704+
if ((dim == 'height' && this.dir == HOR) || (dim == 'width' && this.dir == VER))
701705
{
702-
if(delta)
706+
if (delta)
703707
{
704-
for( ; child = this.children[i]; i++)
708+
for (i = 0; child = this.children[i]; i++)
705709
{
706710
deltas[deltas.length] = child.checkDelta(dim, delta, sibling);
707711
}
708712
min = Math.min.apply(null, deltas);
709713
max = Math.max.apply(null, deltas);
710714
delta_applied = delta > 0 ? max : min;
711-
if( max != min )
715+
if (max != min)
712716
{
713-
for( i = 0; child = this.children[i]; i++)
717+
for (i = 0; child = this.children[i]; i++)
714718
{
715719
child.checkDelta(dim, delta - delta_applied, sibling)
716720
}
@@ -719,7 +723,7 @@
719723
}
720724
else // clear
721725
{
722-
for( i=0; child = this.children[i]; i++)
726+
for (i = 0; child = this.children[i]; i++)
723727
{
724728
child.checkDelta(dim, 0, sibling);
725729
}
@@ -729,7 +733,7 @@
729733
else
730734
{
731735
delta_applied = delta;
732-
for( i = 0; child = this.children[i]; i++) // if delta_applied is zero clear the rest
736+
for (i = 0; child = this.children[i]; i++) // if delta_applied is zero clear the rest
733737
{
734738
delta_applied = child.checkDelta(dim, delta_applied, sibling);
735739
}
@@ -739,26 +743,20 @@
739743
else
740744
{
741745
min = this['min_' + dim];
742-
if( delta)
746+
if (delta)
743747
{
744748
var newDim = this[dim] + delta;
745-
if( newDim >= min || newDim >= this[dim] )
746-
{
749+
if (newDim >= min || newDim >= this[dim])
747750
this['checked_' + dim] = newDim;
748-
}
749751
else
750-
{
751752
this['checked_' + dim] = min;
752-
}
753753
delta_applied = delta - ( this['checked_' + dim] - this[dim] );
754754
}
755755
else // clear
756-
{
757756
delta_applied = this['checked_' + dim] = 0;
758-
}
759757
}
760758
return delta_applied;
761-
}
759+
};
762760

763761
this.getCapTarget = function(dim, target)
764762
{

src/ui-scripts/overlaybackground.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,28 @@ var OverlayBackgroundPrototype = function()
1414

1515
this.setDimensions = function(force_redraw)
1616
{
17-
18-
if(!this.horizontal_border_padding)
17+
if (!this.horizontal_border_padding)
1918
this.setCSSProperties();
20-
2119
var dim = this.cell.top - 1;
22-
if( dim != this.top)
20+
if (dim != this.top)
2321
{
2422
this.is_dirty = true;
2523
this.top = dim;
2624
}
27-
2825
dim = this.cell.left;
29-
if( dim != this.left)
26+
if (dim != this.left)
3027
{
3128
this.is_dirty = true;
3229
this.left = dim;
3330
}
34-
3531
dim = this.cell.width - this.horizontal_border_padding;
36-
if( dim != this.width)
32+
if (dim != this.width)
3733
{
3834
this.is_dirty = true;
3935
this.width = dim;
4036
}
41-
4237
dim = this.cell.height - this.vertical_border_padding + 1;
43-
if( dim != this.height)
38+
if (dim != this.height)
4439
{
4540
this.is_dirty = true;
4641
this.height = dim;

src/ui-scripts/overlayview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ var OverlayViewPrototype = function()
2323
ViewBase.init.call(this, id, "", container_class, html, default_handler);
2424
};
2525
};
26+
2627
OverlayViewPrototype.prototype = ViewBase;
2728
OverlayView.prototype = new OverlayViewPrototype();

src/ui-scripts/ui-actions.js

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var EventHandler = function(type, is_capturing, handler_key, cancel_bubble)
4242
while (ele)
4343
{
4444
handler = ele.getAttribute(handler_key);
45-
while (!(handler && eventHandlers[type][handler]) && (ele = ele.parentNode))
45+
while (!(handler && window.eventHandlers[type][handler]) && (ele = ele.parentNode))
4646
{
4747
handler = ele.nodeType == 1 ? ele.getAttribute(handler_key) : null;
4848
}
@@ -53,17 +53,17 @@ var EventHandler = function(type, is_capturing, handler_key, cancel_bubble)
5353
container =
5454
document.getElementById(ele.parentNode.parentNode.id.replace('toolbar', 'container'));
5555
}
56-
eventHandlers[type][handler](event, ele, container);
56+
window.eventHandlers[type][handler](event, ele, container);
5757
}
5858
ele = cancel_bubble ? null : ele && ele.parentNode;
5959
}
6060
}
6161

6262
this.post = function(handler, event)
6363
{
64-
if(eventHandlers[type][handler])
64+
if(window.eventHandlers[type][handler])
6565
{
66-
eventHandlers[type][handler](event);
66+
window.eventHandlers[type][handler](event);
6767
}
6868
}
6969

@@ -88,7 +88,7 @@ new EventHandler('scroll', true);
8888

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

91-
eventHandlers.mousedown['tab'] = function(event, target)
91+
window.eventHandlers.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 @@ eventHandlers.mousedown['tab'] = function(event, target)
9999
else
100100
{
101101
opera.postError(ui_strings.S_DRAGONFLY_INFO_MESSAGE +
102-
"tabs is missing in eventHandlers.click['tab'] in ui-actions");
102+
"tabs is missing in window.eventHandlers.click['tab'] in ui-actions");
103103
}
104104
}
105105

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

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

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

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

159-
eventHandlers.mousewheel['breadcrumbs-drag'] = function(event, target)
159+
window.eventHandlers.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-
eventHandlers.mousedown['breadcrumbs-drag'] = function(event, target)
165+
window.eventHandlers.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-
eventHandlers.click['settings-tabs'] = function(event, target)
172+
window.eventHandlers.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-
eventHandlers.click['show-search'] = function(event, target)
178+
window.eventHandlers.click['show-search'] = function(event, target)
179179
{
180180
var toolbar = UIBase.getUIById(target.get_attr('parent-node-chain', 'ui-id'));
181181
if (toolbar)
@@ -188,42 +188,38 @@ eventHandlers.click['show-search'] = function(event, target)
188188
}
189189
}
190190

191-
192-
193-
194-
195-
eventHandlers.click['show-window'] = function(event)
191+
window.eventHandlers.click['show-window'] = function(event)
196192
{
197193
var target = event.target;
198194
var view_id = target.getAttribute('view-id');
199195
target.parentNode.parentNode.parentNode.removeChild(target.parentNode.parentNode);
200196
UIWindowBase.showWindow(view_id);
201197
}
202198

203-
eventHandlers.click['documentation'] = function(event)
199+
window.eventHandlers.click['documentation'] = function(event)
204200
{
205201
window.open(event.target.getAttribute('param'), '_info_window').focus();
206202
}
207203

208204

209-
eventHandlers.click['top-window-close'] = function(event)
205+
window.eventHandlers.click['top-window-close'] = function(event)
210206
{
211207
window.close();
212208
}
213209

214-
eventHandlers.click['top-window-toggle-attach'] = function(event)
210+
window.eventHandlers.click['top-window-toggle-attach'] = function(event)
215211
{
216212
window.opera.attached = !window.opera.attached;
217213
window.settings.general.set('window-attached', window.opera.attached);
218214
window.client.create_window_controls();
219215
}
220216

221-
eventHandlers.click['overlay-tab'] = function(event, target)
217+
window.eventHandlers.click['overlay-tab'] = function(event, target)
222218
{
223219
Overlay.get_instance().change_group(event.target.getAttribute("group"));
224220
};
225221

226-
eventHandlers.click['toggle-overlay'] = function(event, target)
222+
window.eventHandlers.click['toggle-overlay'] = function(event, target)
227223
{
228224
var overlay = Overlay.get_instance();
229225
var overlay_id = target.getAttribute("data-overlay-id");
@@ -233,12 +229,12 @@ eventHandlers.click['toggle-overlay'] = function(event, target)
233229
this.broker.dispatch_action("global", "show-overlay", event, target);
234230
};
235231

236-
eventHandlers.click['toggle-console'] = function(event, target)
232+
window.eventHandlers.click['toggle-console'] = function(event, target)
237233
{
238234
this.broker.dispatch_action("global", "toggle-console", event, target);
239235
};
240236

241-
eventHandlers.click['toolbar-switch'] = function(event)
237+
window.eventHandlers.click['toolbar-switch'] = function(event)
242238
{
243239
var target = event.target;
244240
var arr = target.getAttribute('key') && target.getAttribute('key').split('.');
@@ -253,7 +249,7 @@ eventHandlers.click['toolbar-switch'] = function(event)
253249
}
254250
}
255251

256-
eventHandlers.click["toolbar-single-select"] = function(event, target)
252+
window.eventHandlers.click["toolbar-single-select"] = function(event, target)
257253
{
258254
var button = event.target;
259255
var view_id = target.getAttribute("data-view-id");
@@ -306,7 +302,7 @@ eventHandlers.click["toolbar-single-select"] = function(event, target)
306302
}
307303
}
308304

309-
eventHandlers.click["close-overlay-view"] = function(event, target)
305+
window.eventHandlers.click["close-overlay-view"] = function(event, target)
310306
{
311307
var ui_id = target.get_ancestor_attr("ui-id");
312308
var toolbar = UIBase.getUIById(ui_id);
@@ -318,7 +314,7 @@ eventHandlers.click["close-overlay-view"] = function(event, target)
318314

319315
/***** change handler *****/
320316

321-
eventHandlers.change['checkbox-setting'] = function(event)
317+
window.eventHandlers.change['checkbox-setting'] = function(event)
322318
{
323319
var ele = event.target;
324320
var view_id = ele.getAttribute('view-id');

src/ui-style/ui.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,6 @@ info {
18441844
.background-overlay
18451845
{
18461846
position: absolute;
1847-
border: 1px solid #999999;
1848-
box-shadow: 0 2px 5px hsla(0, 0%, 0%, .5);
1847+
border: 1px solid #999;
1848+
box-shadow: 0 2px 5px hsla(0, 0%, 0%, 0.5);
18491849
}

0 commit comments

Comments
 (0)