From ec0dfec53f1e53776cb6b5e026101ef7d8da2a37 Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Tue, 22 Feb 2011 11:56:21 -0800 Subject: [PATCH] Active tab kept in sync after creating a default level folder. --HG-- branch : dev --- .../Orchard.MediaPicker/Scripts/MediaBrowser.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Scripts/MediaBrowser.js b/src/Orchard.Web/Modules/Orchard.MediaPicker/Scripts/MediaBrowser.js index d5a2d4ab4..e442fa9e2 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Scripts/MediaBrowser.js +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Scripts/MediaBrowser.js @@ -69,7 +69,13 @@ }); $(function () { - $("#tabs").tabs({ selected: parseInt(query("tab", location.hash)) || 0 }); + $("#tabs").tabs({ + selected: parseInt(query("tab", location.hash)) || 0, + select: function (event, ui) { + // sync the active tab with the hash value + location.hash = "tab=" + ui.index; + } + }); // populate width and height when image loads // note: load event does not bubble so cannot be used with .live @@ -144,7 +150,7 @@ height: $(prefix + "height").val() }; img.html = getImageHtml(img); - window.opener.jQuery[query("callback")]({ img: img }); + window.opener.jQuery[query("callback")]({ img: img }); window.close(); }