All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] toaster: tablejs Make sure click handlers consume click event
@ 2015-11-26 15:59 Elliot Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Elliot Smith @ 2015-11-26 15:59 UTC (permalink / raw)
  To: bitbake-devel

From: Michael Wood <michael.g.wood@intel.com>

Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
 bitbake/lib/toaster/toastergui/static/js/table.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index 40b5022..c69c205 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -340,7 +340,8 @@ function tableInit(ctx){
     }
   }
 
-  function sortColumnClicked(){
+  function sortColumnClicked(e){
+    e.preventDefault();
 
     /* We only have one sort at a time so remove any existing sort indicators */
     $("#"+ctx.tableName+" th .icon-caret-down").hide();
@@ -476,6 +477,7 @@ function tableInit(ctx){
   });
 
   $("#search-submit-"+ctx.tableName).click(function(e){
+    e.preventDefault();
     var searchTerm = $("#search-input-"+ctx.tableName).val();
 
     tableParams.page = 1;
@@ -489,8 +491,6 @@ function tableInit(ctx){
     }
 
     loadData(tableParams);
-
-    e.preventDefault();
   });
 
   $('.remove-search-btn-'+ctx.tableName).click(function(e){
@@ -514,7 +514,9 @@ function tableInit(ctx){
     e.preventDefault();
   });
 
-  $("#clear-filter-btn-"+ctx.tableName).click(function(){
+  $("#clear-filter-btn-"+ctx.tableName).click(function(e){
+    e.preventDefault();
+
     var filterBtn = $("#" + tableParams.filter.split(":")[0]);
     filterBtnActive(filterBtn, false);
 
-- 
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] toaster: tablejs Make sure click handlers consume click event
  2015-11-13 14:33 Michael Wood
@ 2015-11-16 15:09 ` Barros Pena, Belen
  0 siblings, 0 replies; 3+ messages in thread
From: Barros Pena, Belen @ 2015-11-16 15:09 UTC (permalink / raw)
  To: Wood, Michael G, toaster



On 13/11/2015 14:33, "toaster-bounces@yoctoproject.org on behalf of
Michael Wood" <toaster-bounces@yoctoproject.org on behalf of
michael.g.wood@intel.com> wrote:

>Avoid the click event from propagating and causing strange side effects
>in toaster tables.
>
>[YOCTO #8527]
>[YOCTO #8148]

This definitely fixes 8527. I was never able to reproduce 8148, I'm
afraid, but the sorting seems to be working for me with this patch.

Thanks!

Belén

>
>Signed-off-by: Michael Wood <michael.g.wood@intel.com>
>---
> bitbake/lib/toaster/toastergui/static/js/table.js | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js
>b/bitbake/lib/toaster/toastergui/static/js/table.js
>index 40b5022..c69c205 100644
>--- a/bitbake/lib/toaster/toastergui/static/js/table.js
>+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
>@@ -340,7 +340,8 @@ function tableInit(ctx){
>     }
>   }
> 
>-  function sortColumnClicked(){
>+  function sortColumnClicked(e){
>+    e.preventDefault();
> 
>     /* We only have one sort at a time so remove any existing sort
>indicators */
>     $("#"+ctx.tableName+" th .icon-caret-down").hide();
>@@ -476,6 +477,7 @@ function tableInit(ctx){
>   });
> 
>   $("#search-submit-"+ctx.tableName).click(function(e){
>+    e.preventDefault();
>     var searchTerm = $("#search-input-"+ctx.tableName).val();
> 
>     tableParams.page = 1;
>@@ -489,8 +491,6 @@ function tableInit(ctx){
>     }
> 
>     loadData(tableParams);
>-
>-    e.preventDefault();
>   });
> 
>   $('.remove-search-btn-'+ctx.tableName).click(function(e){
>@@ -514,7 +514,9 @@ function tableInit(ctx){
>     e.preventDefault();
>   });
> 
>-  $("#clear-filter-btn-"+ctx.tableName).click(function(){
>+  $("#clear-filter-btn-"+ctx.tableName).click(function(e){
>+    e.preventDefault();
>+
>     var filterBtn = $("#" + tableParams.filter.split(":")[0]);
>     filterBtnActive(filterBtn, false);
> 
>-- 
>2.5.0
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] toaster: tablejs Make sure click handlers consume click event
@ 2015-11-13 14:33 Michael Wood
  2015-11-16 15:09 ` Barros Pena, Belen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Wood @ 2015-11-13 14:33 UTC (permalink / raw)
  To: toaster

Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 bitbake/lib/toaster/toastergui/static/js/table.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index 40b5022..c69c205 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -340,7 +340,8 @@ function tableInit(ctx){
     }
   }
 
-  function sortColumnClicked(){
+  function sortColumnClicked(e){
+    e.preventDefault();
 
     /* We only have one sort at a time so remove any existing sort indicators */
     $("#"+ctx.tableName+" th .icon-caret-down").hide();
@@ -476,6 +477,7 @@ function tableInit(ctx){
   });
 
   $("#search-submit-"+ctx.tableName).click(function(e){
+    e.preventDefault();
     var searchTerm = $("#search-input-"+ctx.tableName).val();
 
     tableParams.page = 1;
@@ -489,8 +491,6 @@ function tableInit(ctx){
     }
 
     loadData(tableParams);
-
-    e.preventDefault();
   });
 
   $('.remove-search-btn-'+ctx.tableName).click(function(e){
@@ -514,7 +514,9 @@ function tableInit(ctx){
     e.preventDefault();
   });
 
-  $("#clear-filter-btn-"+ctx.tableName).click(function(){
+  $("#clear-filter-btn-"+ctx.tableName).click(function(e){
+    e.preventDefault();
+
     var filterBtn = $("#" + tableParams.filter.split(":")[0]);
     filterBtnActive(filterBtn, false);
 
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-26 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 15:59 [PATCH] toaster: tablejs Make sure click handlers consume click event Elliot Smith
  -- strict thread matches above, loose matches on Subject: below --
2015-11-13 14:33 Michael Wood
2015-11-16 15:09 ` Barros Pena, Belen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.