[hg] galaxy 1547: Improve ajax deleting refreshing of dataset co...

classic Classic list List threaded Threaded
1 message Options
| Threaded
Open this post in threaded view
|

[hg] galaxy 1547: Improve ajax deleting refreshing of dataset co...

Nate Coraor (nate@bx.psu.edu)
details:   http://www.bx.psu.edu/hg/galaxy/rev/684b78f79f8b
changeset: 1547:684b78f79f8b
user:      Dan Blankenberg <[hidden email]>
date:      Mon Oct 06 11:48:35 2008 -0400
description:
Improve ajax deleting refreshing of dataset contents.

2 file(s) affected in this change:

lib/galaxy/model/mapping.py
templates/root/history.mako

diffs (46 lines):

diff -r d93cf9d961bb -r 684b78f79f8b lib/galaxy/model/mapping.py
--- a/lib/galaxy/model/mapping.py Mon Oct 06 09:40:47 2008 -0400
+++ b/lib/galaxy/model/mapping.py Mon Oct 06 11:48:35 2008 -0400
@@ -289,7 +289,7 @@
     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 -r d93cf9d961bb -r 684b78f79f8b templates/root/history.mako
--- a/templates/root/history.mako Mon Oct 06 09:40:47 2008 -0400
+++ b/templates/root/history.mako Mon Oct 06 11:48:35 2008 -0400
@@ -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;