Skip to content

Commit a81a32c

Browse files
committed
Fixed DFL-3677: Escape key should close overlay in profiler.
1 parent 8631545 commit a81a32c

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/profiler/profiler_view.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
300300
}
301301
};
302302

303+
this._close_details_overlay = function(event, target)
304+
{
305+
this._overlay.hide();
306+
};
307+
303308
this._get_aggregated_event_list = function(event_list)
304309
{
305310
var list = this._default_types.map(function(type) {
@@ -313,9 +318,7 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
313318
for (var i = 0, item; item = list[i]; i++)
314319
{
315320
if (item.type == type)
316-
{
317321
item.time += event.time;
318-
}
319322
}
320323
});
321324
return list;
@@ -539,6 +542,13 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
539542
this._handle_stop_profiler_bound = this._handle_stop_profiler.bind(this);
540543
this._handle_timeline_list_bound = this._handle_timeline_list.bind(this);
541544
this._handle_details_list_bound = this._handle_details_list.bind(this);
545+
this._close_details_overlay_bound = this._close_details_overlay.bind(this);
546+
547+
ActionHandlerInterface.apply(this);
548+
this._handlers = {
549+
"close-details": this._close_details_overlay_bound
550+
};
551+
ActionBroker.get_instance().register_handler(this);
542552

543553
window.messages.addListener("profile-enabled", this._on_profile_enabled.bind(this));
544554
window.messages.addListener("single-select-changed", this._on_single_select_changed.bind(this));

src/scripts/ini.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@
215215
"down": "select-next-entry"
216216
}
217217
},
218+
"profiler_all": {
219+
"default":
220+
{
221+
"escape": "close-details"
222+
}
223+
},
218224
"search":
219225
{
220226
"default":
@@ -433,6 +439,12 @@
433439
"down": "select-next-entry"
434440
}
435441
},
442+
"profiler_all": {
443+
"default":
444+
{
445+
"escape": "close-details"
446+
}
447+
},
436448
"search":
437449
{
438450
"default":

0 commit comments

Comments
 (0)