From fc3537dbeb41dedbcaa3a9a26663e3ea26259c81 Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Tue, 1 Feb 2011 14:55:55 -0500
Subject: [PATCH] undo entity widget
 adds line level undo for the entity-select-widget
 https://fedorahosted.org/freeipa/ticket/886

---
 install/ui/widget.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/install/ui/widget.js b/install/ui/widget.js
index b5c02ee33314ff175223ab01ed8c5407d57414d2..b9244f07cd2bebe8db489eb1ec98e11199f86872 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1100,7 +1100,7 @@ IPA.entity_select_widget = function(spec){
         that.entity_select = $('<select/>', {
             id: that.name + '-entity-select',
             change: function(){
-
+                that.show_undo();
             }
         }).appendTo(dd);
 
@@ -1124,10 +1124,20 @@ IPA.entity_select_widget = function(spec){
                 return false;
             }
         }).appendTo(dd);
+
+        if (that.undo) {
+            that.create_undo(dd);
+        }
+        var undo = that.get_undo();
+        undo.click(function() {
+            that.reset();
+        });
+
         populate_select();
     };
     that.reset = function(){
         that.entity_filter.val(that.values[0]);
+        that.hide_undo();
         populate_select(that.values[0]);
 
     };
-- 
1.7.3.5

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to