2011-02-04 Pavel Podivilov <podivilov@chromium.org>
[WebKit.git] / Source / WebCore / inspector / front-end / ScriptsPanel.js
index fceef641f5f23776b4504306f213ffd181d343fb..39ac02bbbdf65545e08932eacc8eeab499ac04b4 100644 (file)
@@ -299,17 +299,26 @@ WebInspector.ScriptsPanel.prototype = {
     _resourceLoadingFinished: function(e)
     {
         var resource = e.target;
+
+        var visible = false;
+        var select = this.filesSelectElement;
         for (var i = 0; i < resource._scriptsPendingResourceLoad.length; ++i) {
             // Bind script to resource.
             var script = resource._scriptsPendingResourceLoad[i];
             script.resource = resource;
 
+            if (select.options[select.selectedIndex] === script.filesSelectOption)
+                visible = true;
+
             // Remove script from the files list.
             script.filesSelectOption.parentElement.removeChild(script.filesSelectOption);
         }
         // Adding first script will add resource.
         this._addScriptToFilesMenu(resource._scriptsPendingResourceLoad[0]);
         delete resource._scriptsPendingResourceLoad;
+
+        if (visible)
+            this._showScriptOrResource(resource, { initialLoad: true });
     },
 
     addConsoleMessage: function(message)