1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/63fc9cbe381d/ changeset: 63fc9cbe381d user: carlfeberhard date: 2012-12-07 22:02:21 summary: history panel and popupmenu: various fixes for IE affected #: 3 files diff -r b516a3fb0fc102c1b0b527f072e86a4afc74679e -r 63fc9cbe381d2719134f87c019911565e3a934a1 templates/base.mako --- a/templates/base.mako +++ b/templates/base.mako @@ -54,7 +54,7 @@ info : function(){}, warn : function(){}, error : function(){}, - assert : function(){}, + assert : function(){} }; // Set up needed paths. diff -r b516a3fb0fc102c1b0b527f072e86a4afc74679e -r 63fc9cbe381d2719134f87c019911565e3a934a1 templates/base/base_panels.mako --- a/templates/base/base_panels.mako +++ b/templates/base/base_panels.mako @@ -75,7 +75,7 @@ info : function(){}, warn : function(){}, error : function(){}, - assert : function(){}, + assert : function(){} }; // Set up needed paths. diff -r b516a3fb0fc102c1b0b527f072e86a4afc74679e -r 63fc9cbe381d2719134f87c019911565e3a934a1 templates/root/alternate_history.mako --- a/templates/root/alternate_history.mako +++ b/templates/root/alternate_history.mako @@ -287,7 +287,7 @@ top.Galaxy.currUser = top.Galaxy.currUser; top.Galaxy.currHistoryPanel = top.Galaxy.currHistoryPanel; - top.Galaxy.paths = galaxy_paths; + //top.Galaxy.paths = galaxy_paths; top.Galaxy.localization = GalaxyLocalization; window.Galaxy = top.Galaxy; @@ -297,12 +297,13 @@ GalaxyLocalization.setLocalizedString( ${ create_localization_json( get_page_localized_strings() ) } ); // add needed controller urls to GalaxyPaths +if( !galaxy_paths ){ galaxy_paths = top.galaxy_paths || new GalaxyPaths(); } galaxy_paths.set( 'hda', ${get_hda_url_templates()} ); galaxy_paths.set( 'history', ${get_history_url_templates()} ); $(function(){ galaxyPageSetUp(); - Galaxy.historyFrame = window; + //Galaxy.historyFrame = window; var debugging = ( new PersistantStorage( '__history_panel' ).get( 'debugging' ) || false ); @@ -387,6 +388,7 @@ } // lots of wtf here...due to infernalframes + //TODO: this is way tooo acrobatic var $historyButtonWindow = $( top.document ), HISTORY_MENU_BUTTON_ID = 'history-options-button', $historyMenuButton = $historyButtonWindow.find( '#' + HISTORY_MENU_BUTTON_ID ), @@ -410,44 +412,50 @@ // since the history frame reloads so often (compared to the main window), // we need to check whether these options are there already before we add them again - //NOTE: we use the global here because these remain bound in the main window even if panel refreshes + // In IE, however, NOT re-adding them creates a 'cant execute from freed script' error: + // so...we need to re-add the function in either case (just not the option itself) + //NOTE: we use the global Galaxy.currHistoryPanel here + // because these remain bound in the main window even if panel refreshes //TODO: too much boilerplate - if( popupMenu.findIndexByHtml( COLLAPSE_OPTION_TEXT ) === null ){ - popupMenu.addItem({ - html : COLLAPSE_OPTION_TEXT, - func : function() { - Galaxy.currHistoryPanel.collapseAllHdaBodies(); - } - }, START_INSERTING_AT_INDEX ) + //TODO: ugh...(in general) + var collapseOption = popupMenu.findItemByHtml( COLLAPSE_OPTION_TEXT ); + if( !collapseOption ){ + collapseOption = { + html : COLLAPSE_OPTION_TEXT + }; + popupMenu.addItem( collapseOption, START_INSERTING_AT_INDEX ) } + collapseOption.func = function() { + Galaxy.currHistoryPanel.collapseAllHdaBodies(); + }; - var deletedOptionIndex = popupMenu.findIndexByHtml( DELETED_OPTION_TEXT ); - if( deletedOptionIndex === null ){ - popupMenu.addItem({ - html : DELETED_OPTION_TEXT, - func : function( clickEvent, thisMenuOption ){ - var show_deleted = Galaxy.currHistoryPanel.toggleShowDeleted(); - thisMenuOption.checked = show_deleted; - } - }, START_INSERTING_AT_INDEX + 1 ) - deletedOptionIndex = START_INSERTING_AT_INDEX + 1; + var deletedOption = popupMenu.findItemByHtml( DELETED_OPTION_TEXT ); + if( !deletedOption ){ + deletedOption = { + html : DELETED_OPTION_TEXT + }; + popupMenu.addItem( deletedOption, START_INSERTING_AT_INDEX + 1 ) } + deletedOption.func = function( clickEvent, thisMenuOption ){ + var show_deleted = Galaxy.currHistoryPanel.toggleShowDeleted(); + thisMenuOption.checked = show_deleted; + }; // whether was there or added, update the checked option to reflect the panel's settings on the panel render - popupMenu.options[ deletedOptionIndex ].checked = Galaxy.currHistoryPanel.storage.get( 'show_deleted' ); + deletedOption.checked = Galaxy.currHistoryPanel.storage.get( 'show_deleted' ); - var hiddenOptionIndex = popupMenu.findIndexByHtml( HIDDEN_OPTION_TEXT ); - if( hiddenOptionIndex === null ){ - popupMenu.addItem({ - html : HIDDEN_OPTION_TEXT, - func : function( clickEvent, thisMenuOption ){ - var show_hidden = Galaxy.currHistoryPanel.toggleShowHidden(); - thisMenuOption.checked = show_hidden; - } - }, START_INSERTING_AT_INDEX + 2 ) - hiddenOptionIndex = START_INSERTING_AT_INDEX + 2; + var hiddenOption = popupMenu.findItemByHtml( HIDDEN_OPTION_TEXT ); + if( !hiddenOption ){ + hiddenOption = { + html : HIDDEN_OPTION_TEXT + }; + popupMenu.addItem( hiddenOption, START_INSERTING_AT_INDEX + 2 ) } + hiddenOption.func = function( clickEvent, thisMenuOption ){ + var show_hidden = Galaxy.currHistoryPanel.toggleShowHidden(); + thisMenuOption.checked = show_hidden; + }; // whether was there or added, update the checked option to reflect the panel's settings on the panel render - popupMenu.options[ hiddenOptionIndex ].checked = Galaxy.currHistoryPanel.storage.get( 'show_hidden' ); + hiddenOption.checked = Galaxy.currHistoryPanel.storage.get( 'show_hidden' ); })(); //TODO: both the quota meter and the options-menu stuff need to be moved out when iframes are removed Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.