Skip to content

Commit 26d5ac8

Browse files
author
p01
committed
Fix for DFL-3350, handling highlight of resources used by multiple runtimes.
1 parent e922568 commit 26d5ac8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/resource-manager/resource_service.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ cls.ResourceManagerService = function(view, network_logger)
6262

6363
var ctx = {};
6464
// get list of window_contexts for which we saw the main_document
65-
ctx.windowList = (this._network_logger.get_window_contexts()||[]).filter(function(w)
65+
ctx.windowList = (this._network_logger.get_window_contexts()||[])
66+
.filter(function(w)
6667
{
6768
return w.saw_main_document;
6869
});
@@ -229,25 +230,24 @@ cls.ResourceManagerService = function(view, network_logger)
229230

230231
this.highlight_resource = function(id)
231232
{
233+
var list, i, e;
232234
if (this._selectedResourceID == id)
233235
return;
234236

235237
if (this._selectedResourceID)
236238
{
237-
var r = document.getElementById('resource-'+this._selectedResourceID);
238-
if (r)
239-
r.classList.remove('resource-highlight');
239+
list = document.querySelectorAll('*[data-resource-id="'+ this._selectedResourceID +'"]');
240+
for(i=0; e=list[i]; i++)
241+
e.classList.remove('resource-highlight');
240242
}
241-
this._selectedResourceID = id;
242243

244+
this._selectedResourceID = id;
243245
if (this._context)
244246
this._context.selectedResourceID = id;
245247

246-
var r = document.getElementById('resource-'+this._selectedResourceID);
247-
if (r)
248-
r.classList.add('resource-highlight');
249-
250-
// this._view.update();
248+
list = document.querySelectorAll('*[data-resource-id="'+ this._selectedResourceID +'"]');
249+
for(i=0; e=list[i]; i++)
250+
e.classList.add('resource-highlight');
251251
}.bind(this);
252252

253253

0 commit comments

Comments
 (0)