[Freeipa-devel] [PATCH] admiyo-0185-undo-entity-widget

2011-02-01 Thread Adam Young


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

Re: [Freeipa-devel] [PATCH] admiyo-0185-undo-entity-widget

2011-02-01 Thread Adam Young

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

Re: [Freeipa-devel] [PATCH] admiyo-0185-undo-entity-widget

2011-02-01 Thread Adam Young

On 02/01/2011 03:49 PM, Adam Young wrote:

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


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
edewata noticed that the the search wasn't working under the following 
sequence:

 double click to highlight all, then backspace to remove it:
 the undo shows up, but the list is not updated

That was due to triggering the login on keyp[ress instead of key up
From 4987ebe71f95aede5525f230af679b7f93573575 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
 does JSON queries on keyup instead of keypress
 https://fedorahosted.org/freeipa/ticket/886

---
 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 b5c02ee33314ff175223ab01ed8c5407d57414d2..8c080787b11e40693946395ce7c21ca14dc254e9 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]);
 
 };
-- 
1.7.3.5

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

Re: [Freeipa-devel] [PATCH] admiyo-0185-undo-entity-widget

2011-02-01 Thread Endi Sukma Dewata

On 2/1/2011 3:25 PM, Adam Young wrote:

NOw shows undo link if the filter changes

edewata noticed that the the search wasn't working under the following
sequence:
double click to highlight all, then backspace to remove it:
the undo shows up, but the list is not updated

That was due to triggering the login on keyp[ress instead of key up


ACK and pushed to master.

--
Endi S. Dewata

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