Permalink
Browse files

Disable AJAX for schema change

  • Loading branch information...
1 parent a4982c9 commit 06a916102d60fe206996b88e4c62329ff5c47162 @vrana committed Nov 28, 2010
Showing with 5 additions and 3 deletions.
  1. +1 −1 adminer/include/design.inc.php
  2. +4 −2 adminer/static/functions.js
@@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
-<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
+<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
@@ -372,9 +372,10 @@ function selectDblClick(td, event, text) {
/** Load link by AJAX
* @param MouseEvent
* @param string
+* @param string
* @return bool
*/
-function bodyClick(event, db) {
+function bodyClick(event, db, ns) {
if (event.getPreventDefault ? event.getPreventDefault() : !event.returnValue) {
return false;
}
@@ -384,7 +385,8 @@ function bodyClick(event, db) {
}
if (/^a$/i.test(el.tagName) && !/^https?:|#/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) {
var match = /&db=([^&]*)/.exec(el.href);
- return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event));
+ var match2 = /&ns=([^&]*)/.exec(el.href);
+ return !(db == (match ? match[1] : '') && scheme == (match2 ? match2[1] : '') && ajaxMain(el.href, '', event));
}
if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && el.name != 'logout' && !/&(database|scheme|create|view|sql|user)=/.test(location.href)) {
return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + '=1' : ''));

0 comments on commit 06a9161

Please sign in to comment.