diff options
author | Adam Young <ayoung@redhat.com> | 2011-02-01 14:55:55 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-02-01 16:37:42 -0500 |
commit | c704ae605a5ee19642cc5dbf0189f416c8ff4588 (patch) | |
tree | b0ab5754f54727d4e8d6b99865bf90b752acff87 | |
parent | c6ef39b2c04c7b09848226d7454c983924cbdfed (diff) | |
download | freeipa-c704ae605a5ee19642cc5dbf0189f416c8ff4588.tar.gz freeipa-c704ae605a5ee19642cc5dbf0189f416c8ff4588.tar.xz freeipa-c704ae605a5ee19642cc5dbf0189f416c8ff4588.zip |
undo entity widget adds line level undo for the entity-select-widget now shows the undo link on filter change does JSON queries on keyup instead of keypress https://fedorahosted.org/freeipa/ticket/886
-rw-r--r-- | install/ui/widget.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index b5c02ee3..8c080787 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); @@ -1110,8 +1110,9 @@ IPA.entity_select_widget = function(spec){ type: 'text', id: 'entity_filter', style: 'display: none;', - keypress: function(){ + keyup: 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]); }; |