From 2bb78ef75510c7f8f3ffd3289895ef14d902cbe5 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Mon, 6 Oct 2008 11:48:35 -0400 Subject: [PATCH] Improve ajax deleting refreshing of dataset contents. --- lib/galaxy/model/mapping.py | 2 +- templates/root/history.mako | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index 93086ded669..c59e16968e0 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -289,7 +289,7 @@ assign_mapper( context, History, History.table, properties=dict( galaxy_sessions=relation( GalaxySessionToHistoryAssociation ), datasets=relation( HistoryDatasetAssociation, backref="history", order_by=asc(HistoryDatasetAssociation.table.c.hid) ), active_datasets=relation( HistoryDatasetAssociation, primaryjoin=( ( HistoryDatasetAssociation.table.c.history_id == History.table.c.id ) & ( not_( HistoryDatasetAssociation.table.c.deleted ) ) ), order_by=asc( HistoryDatasetAssociation.table.c.hid ), lazy=False, viewonly=True ), - activatable_datasets=relation( HistoryDatasetAssociation, primaryjoin=( ( HistoryDatasetAssociation.table.c.history_id == History.table.c.id ) & ( not_( Dataset.table.c.purged ) ) ), order_by=asc( HistoryDatasetAssociation.table.c.hid ), lazy=False, viewonly=True ) + activatable_datasets=relation( HistoryDatasetAssociation, primaryjoin=( ( HistoryDatasetAssociation.table.c.history_id == History.table.c.id ) & ( not_( Dataset.table.c.purged ) ) ), order_by=asc( HistoryDatasetAssociation.table.c.hid ), lazy=True, viewonly=True ) ) ) assign_mapper( context, User, User.table, diff --git a/templates/root/history.mako b/templates/root/history.mako index 201835227a6..7491b5b4a12 100644 --- a/templates/root/history.mako +++ b/templates/root/history.mako @@ -91,19 +91,18 @@ url: "${h.url_for( action='delete_async', id='XXX' )}".replace( 'XXX', data_id ), error: function() { alert( "Delete failed" ) }, success: function() { - if ( "${show_deleted}" == "True" ){ - var to_update = {}; - to_update[data_id] = "none"; - updater( to_update ); + %if show_deleted: + var to_update = {}; + to_update[data_id] = "none"; + updater( to_update ); + %else: + q( "#historyItem-" + data_id ).fadeOut( "fast", function() { + q( "div#historyItemContainer-" + data_id ).remove(); + if ( q( "div.historyItemContainer" ).length < 1 ) { + q ( "div#emptyHistoryMessage" ).show(); } - else { - q( "#historyItem-" + data_id ).fadeOut( "fast", function() { - q( "div#historyItemContainer-" + data_id ).remove(); - if ( q( "div.historyItemContainer" ).length < 1 ) { - q ( "div#emptyHistoryMessage" ).show(); - } - }); - } + }); + %endif } }); return false;