Le 2011-05-13 16:06, Aris Feryanto a écrit :
Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding
<script> tag to call js function in the navigation frame, any better way?)
Hi Aris, How about this?
diff --git a/js/functions.js b/js/functions.js index 572c857..50fd6f8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2276,5 +2276,9 @@ $(document).ready(function() { } });
+ $('#update_recent_tables').ready(function() { + window.parent.frame_navigation.PMA_reloadRecentTable(); + }); + }) // end of $(document).ready()
diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 05d272e..4036f86 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -21,9 +21,7 @@ require_once './libraries/RecentTable.class.php'; function PMA_addRecentTable($db, $table) { $tmp_result = RecentTable::getInstance()->add($db, $table); if ($tmp_result === true) { - echo '<script type="text/javascript">' . - 'window.parent.frame_navigation.PMA_reloadRecentTable();' . - '</script>'; + echo '<span class="hide" id="update_recent_tables"></span>'; } else { $error = $tmp_result; $error->display();