[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0BETA3-2033-ga46a49b

Piotr Przybylski crackpl at users.sourceforge.net
Thu Mar 10 18:48:41 CET 2011


The branch, master has been updated
       via  a46a49b747f89cdc926fd7d2fd41237d6d060ee7 (commit)
      from  149af3e6872e9f0882aaf6fc51c38aa5657b558e (commit)


- Log -----------------------------------------------------------------
commit a46a49b747f89cdc926fd7d2fd41237d6d060ee7
Author: Piotr Przybylski <piotrprz at gmail.com>
Date:   Thu Mar 10 18:48:16 2011 +0100

    make PMA_changeClassForColumn work about 1/4th faster

-----------------------------------------------------------------------

Summary of changes:
 js/sql.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/js/sql.js b/js/sql.js
index aa49d8e..a7b8e62 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -998,10 +998,14 @@ function PMA_changeClassForColumn($this_th, newclass) {
     var th_index = $this_th.index();
     // .eq() is zero-based
     th_index--;
-    var $tr_with_data = $this_th.closest('table').find('tbody tr ').has('td.data');
-    $tr_with_data.each(function() {
-        $(this).find('td.data:eq('+th_index+')').toggleClass(newclass);
-    });
+    var $tds = $this_th.closest('table').find('tbody tr').find('td.data:eq('+th_index+')');
+    if ($this_th.data('has_class_'+newclass)) {
+        $tds.removeClass(newclass);
+        $this_th.data('has_class_'+newclass, false);
+    } else {
+        $tds.addClass(newclass);
+        $this_th.data('has_class_'+newclass, true);
+    }
 }
 
 $(document).ready(function() {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list