Skip to content

Commit 392e713

Browse files
committed
More fixes based on code review.
1 parent 2bb84d5 commit 392e713

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/profiler/profiler_view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
455455
for (var i = 0, event; event = timeline_list.eventList[i]; i++)
456456
{
457457
var ele = document.getElementById("profiler-event-" + event.eventID);
458-
if (visible_event_list.indexOf(event) != -1)
458+
if (visible_event_list.contains(event))
459459
{
460460
if (ele)
461461
{

src/ui-scripts/zoomer/zoomer.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ var ZoomerPrototype = function()
153153
{
154154
var mouse_x = event.clientX - this._zoomer_ele_left;
155155
var diff = (mouse_x < this._overlay_left) ? MOUSEWHEEL_DIFF : -MOUSEWHEEL_DIFF;
156-
diff *= (event.wheelDelta > 0) ? 1 : -1;
156+
if (event.wheelDelta < 0)
157+
diff = -diff;
157158
this.move_overlay(diff);
158159
event.stopPropagation();
159160
};
@@ -343,10 +344,6 @@ var ZoomerPrototype = function()
343344
*/
344345
this._set_overlay_position = function(left, right)
345346
{
346-
if (left == null)
347-
left = 0;
348-
else if (right == null)
349-
right = 0;
350347
this._overlay_left = Math.max(0, Math.min(left, right));
351348
this._overlay_right = Math.max(0, this._to_right_x(Math.max(left, right)));
352349
};
@@ -455,8 +452,10 @@ var ZoomerPrototype = function()
455452
{
456453
if (left_diff == null)
457454
left_diff = 0;
458-
else if (right_diff == null)
455+
456+
if (right_diff == null)
459457
right_diff = 0;
458+
460459
var left = this._overlay_left + left_diff;
461460
var right = this._overlay_right - right_diff;
462461
this._set_overlay_position(left, this._to_right_x(right));
@@ -468,6 +467,12 @@ var ZoomerPrototype = function()
468467
*/
469468
this.set_overlay_position = function(left, right)
470469
{
470+
if (left == null)
471+
left = 0;
472+
473+
if (right == null)
474+
right = 0;
475+
471476
this._set_overlay_position(left, right);
472477
this._request_update();
473478
};

0 commit comments

Comments
 (0)