9426: tags display
[arvados.git] / apps / workbench / app / assets / javascripts / edit_collection_tags.js
index 26b0ba7eb9ac4783798b7fb9150c7d45f71fbcb0..8dc9d6138f2399dc162de07a9d966998d89b74b1 100644 (file)
@@ -3,6 +3,7 @@
 $(document).
     on('click', '.collection-tag-save, .collection-tag-cancel', function(event) {
         $('.edit-collection-tags').removeClass('disabled');
+        $('#edit-collection-tags').attr("title", "Edit tags");
         $('.collection-tag-add').addClass('hide');
         $('.collection-tag-remove').addClass('hide');
         $('.collection-tag-save').addClass('hide');
@@ -11,6 +12,7 @@ $(document).
     }).
     on('click', '.edit-collection-tags', function(event) {
         $('.edit-collection-tags').addClass('disabled');
+        $('#edit-collection-tags').attr("title", "");
         $('.collection-tag-add').removeClass('hide');
         $('.collection-tag-remove').removeClass('hide');
         $('.collection-tag-save').removeClass('hide');
@@ -37,6 +39,11 @@ $(document).
       }).fail(function(jqxhr, status, error) {
         $('.collection-tags-status').append('<div class="collection-tags-status-label alert alert-danger"><p class="contain-align-left">We are sorry. There was an error saving tags. Please try again.</p></div>');
       });
+    }).
+    on('click', '.collection-tag-cancel', function(e){
+      $.ajax($(location).attr('pathname')+'/tags', {
+          type: 'POST'
+      });
     });
 
 jQuery(function($){