[Freeipa-devel] [PATCH] admiyo-0198-search-filter-focus

2011-02-21 Thread Adam Young
Not going to complete the whole tab-order aspect, but this covers the 
most important part, which is hitting enter and also focus for the 
filter field
From bfb42f808cb7928768a40a6393b217c1aa60f9c6 Mon Sep 17 00:00:00 2001
From: Adam Young ayo...@redhat.com
Date: Mon, 21 Feb 2011 17:28:06 -0500
Subject: [PATCH] search filter focus
 afdter a search loads, focus moved to the search filter text box, tyhe most likely thing that the user will want to change on the page.

https://fedorahosted.org/freeipa/ticket/983
---
 install/ui/details.js |5 -
 install/ui/search.js  |   12 +++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/install/ui/details.js b/install/ui/details.js
index f579fb612d4cb21edf582f86a4f7f220bee857f3..a2ad0896188470087981aa763237ba4f4751105d 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -571,7 +571,10 @@ IPA.button = function(spec) {
 'class': 'ui-state-default ui-corner-all'
 });
 
-if (spec.click) button.click(spec.click);
+if (spec.click) {
+button.click(spec.click);
+}
+
 if (spec['class']) button.addClass(spec['class']);
 
 if (spec.icon) {
diff --git a/install/ui/search.js b/install/ui/search.js
index 11aa4f756fb17a41853ca0ff135ece8e5ecf60aa..101347f980f123f4afe38a3073ee1f606537e1d9 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -88,11 +88,20 @@ IPA.search_widget = function (spec) {
 
 var search_filter = $('span[name=search-filter]', that.container);
 
+$('input[type=text]',search_filter).keypress(
+function(e) {
+/* if the key pressed is the enter key */
+if (e.which == 13) {
+that.find();
+}
+});
 var button = $('input[name=find]', search_filter);
 that.find_button = IPA.button({
 'label': IPA.messages.buttons.find,
 'icon': 'ui-icon-search',
-'click': function() { that.find(); }
+'click': function() {
+that.find();
+}
 });
 button.replaceWith(that.find_button);
 
@@ -247,6 +256,7 @@ IPA.search_widget = function (spec) {
 } else {
 summary.text(data.result.summary);
 }
+$('.search-filter input[type=text]', that.container).focus();
 }
 
 function on_error(xhr, text_status, error_thrown) {
-- 
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-0198-search-filter-focus

2011-02-21 Thread Endi Sukma Dewata

On 2/21/2011 4:32 PM, Adam Young wrote:

Not going to complete the whole tab-order aspect, but this covers the
most important part, which is hitting enter and also focus for the
filter field


ACK and pushed to master.

--
Endi S. Dewata

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