From ccd87a4aabc551ba23dbf52b8f5fb5c34e954dc4 Mon Sep 17 00:00:00 2001 From: Surfoo Date: Sat, 28 Feb 2015 23:31:45 +0100 Subject: [PATCH 1/2] Added support for the touchend event on mobile devices. --- stupidtable.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stupidtable.js b/stupidtable.js index 851ba4c..8468075 100644 --- a/stupidtable.js +++ b/stupidtable.js @@ -11,6 +11,9 @@ $table.on("click.stupidtable", "thead th", function() { $(this).stupidsort(); }); + $table.on("touchend.stupidtable", "thead th", function() { + $(this).stupidsort(); + }); }); }; From 6469d509dbbd4f3f6f776529cea5ad91a385edb9 Mon Sep 17 00:00:00 2001 From: Surfoo Date: Sat, 28 Feb 2015 23:34:17 +0100 Subject: [PATCH 2/2] Shortest code for the same thing. --- stupidtable.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stupidtable.js b/stupidtable.js index 8468075..0abf0ae 100644 --- a/stupidtable.js +++ b/stupidtable.js @@ -8,12 +8,8 @@ sortFns = $.extend({}, $.fn.stupidtable.default_sort_fns, sortFns); $table.data('sortFns', sortFns); - $table.on("click.stupidtable", "thead th", function() { - $(this).stupidsort(); - }); - $table.on("touchend.stupidtable", "thead th", function() { - $(this).stupidsort(); - }); + $table.on("click.stupidtable", "thead th", $(this).stupidsort); + $table.on("touchend.stupidtable", "thead th", $(this).stupidsort); }); };