diff --git a/static/js/pandora.js b/static/js/pandora.js index 8224a4725..ad8f2fc59 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -228,7 +228,7 @@ appPanel document: $(document), window: $(window) .on({ - beforeunload: pandora.beforeunloadWindow, + beforeunload: pandora.beforeUnloadWindow, resize: pandora.resizeWindow, unload: pandora.unloadWindow }) diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index 067c3c21f..d39292cd8 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -157,6 +157,7 @@ pandora.addList = function() { }).reloadList(); } }; + pandora.addText = function(options) { var $folderList = pandora.$ui.folderList.personal; options = options || {}; @@ -177,6 +178,13 @@ pandora.addText = function(options) { } } +pandora.beforeUnloadWindow = function() { + if (pandora.firefogg) + return Ox._("Encoding is currently running\nDo you want to leave this page?"); + //prevent error dialogs on unload + pandora.isUnloading = true; +}; + pandora.changeFolderItemStatus = function(id, status, callback) { var ui = pandora.user.ui, folderItems = ui.section == 'items' ? 'Lists' : Ox.toTitleCase(ui.section), @@ -1463,18 +1471,11 @@ pandora.selectList = function() { }; pandora.setLocale = function(locale, callback) { - Ox.setLocale(locale, locale && locale != 'en' - ? '/static/json/locale.' + locale + '.json' - : void 0, function(result) { - callback(result); - }); -} - -pandora.beforeunloadWindow = function() { - if (pandora.firefogg) - return Ox._("Encoding is currently running\nDo you want to leave this page?"); - //prevent error dialogs on unload - pandora.isUnloading = true; + Ox.setLocale( + locale, + locale && locale != 'en' ? '/static/json/locale.' + locale + '.json' : null, + callback + ); }; pandora.unloadWindow = function() {