[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0BETA1-1326-g818965f

Marc Delisle lem9 at users.sourceforge.net
Thu Dec 30 12:52:34 CET 2010


The branch, master has been updated
       via  818965f8830ee877a4bbfe5f4255dd2db0b8ae10 (commit)
      from  0c979971a28c05e3fece7fb21ff2937e92c6d5e9 (commit)


- Log -----------------------------------------------------------------
commit 818965f8830ee877a4bbfe5f4255dd2db0b8ae10
Author: Marc Delisle <marc at infomarc.info>
Date:   Thu Dec 30 06:50:23 2010 -0500

    Inline edit links were not displayed in search results

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

Summary of changes:
 js/sql.js        |   10 +++++-----
 js/tbl_select.js |   20 ++++++++++++++++++++
 tbl_select.php   |    1 +
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/js/sql.js b/js/sql.js
index d9ecdea..8e7bab2 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -54,10 +54,11 @@ function getFieldName($this_field, disp_mode) {
  * The function that iterates over each row in the table_results and appends a
  * new inline edit anchor to each table row.
  *
- * @param   disp_mode   string
  */
-function appendInlineAnchor(disp_mode) {
-    if(disp_mode == 'vertical') {
+function appendInlineAnchor() {
+    var disp_mode = $("#top_direction_dropdown").val();
+
+    if (disp_mode == 'vertical') {
         // there can be one or two tr containing this class, depending
         // on the ModifyDeleteAtLeft and ModifyDeleteAtRight cfg parameters 
         $('#table_results tr')
@@ -163,10 +164,9 @@ $(document).ready(function() {
      * Attach the {@link appendInlineAnchor} function to a custom event, which
      * will be triggered manually everytime the table of results is reloaded
      * @memberOf    jQuery
-     * @name        sqlqueryresults_live
      */
     $("#sqlqueryresults").live('appendAnchor',function() {
-        appendInlineAnchor(disp_mode);
+        appendInlineAnchor();
     })
 
     /**
diff --git a/js/tbl_select.js b/js/tbl_select.js
index 6b03cce..208daac 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -22,6 +22,25 @@ $(document).ready(function() {
         cache: 'false'
     });
 
+    /**
+     * Attach the {@link appendInlineAnchor} function to a custom event, which
+     * will be triggered manually everytime the table of results is reloaded;
+     *
+     * Needs appendInlineAnchor() which is defined in sql.js
+     * @memberOf    jQuery
+     */
+    $("#searchresults").live('appendAnchor',function() {
+        appendInlineAnchor();
+    })
+
+    /**
+     * Trigger the appendAnchor event to prepare the first table for inline edit
+     *
+     * @memberOf    jQuery
+     */
+    $("#searchresults").trigger('appendAnchor');
+
+
     $('<a id="togglesearchform"></a>')
      .html(PMA_messages['strShowSearchCriteria'])
      .insertAfter('#tbl_search_form')
@@ -63,6 +82,7 @@ $(document).ready(function() {
             if (typeof response == 'string') {
                 // found results
                 $("#searchresults").html(response);
+                $("#searchresults").trigger('appendAnchor');
                 $('#tbl_search_form').hide();
                 $('#togglesearchform')
                  // always start with the Show message
diff --git a/tbl_select.php b/tbl_select.php
index a680c86..6913a9a 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -16,6 +16,7 @@
 require_once './libraries/common.inc.php';
 require_once './libraries/mysql_charsets.lib.php';
 
+$GLOBALS['js_include'][] = 'sql.js';
 $GLOBALS['js_include'][] = 'tbl_select.js';
 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
 $GLOBALS['js_include'][] = 'jquery/timepicker.js';


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list