On 02/01/2011 02:57 PM, Adam Young wrote:



_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
NOw shows undo link if the filter changes
From 419b755871b1de7256f7ca540bf6058ef5075f8f 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
 now shows the undo link on filter change
 https://fedorahosted.org/freeipa/ticket/886

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

diff --git a/install/ui/widget.js b/install/ui/widget.js
index b5c02ee33314ff175223ab01ed8c5407d57414d2..c3f179a9d8f1fabdb87a3ed9a88613021c1455b7 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);
 
@@ -1112,6 +1112,7 @@ IPA.entity_select_widget = function(spec){
             style: 'display: none;',
             keypress: function(){
                 populate_select();
+                that.show_undo();
             }
         }).appendTo(dd);
 
@@ -1124,10 +1125,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