The branch, master has been updated
via b0cbd4c59a302838fff47491f14fc0855287c2be (commit)
via 2a49e9fdab4bd4ec3a613c854cec755580d67a5b (commit)
from d297e0b574615da467c4614cb6ea622b18dd5656 (commit)
- Log -----------------------------------------------------------------
commit b0cbd4c59a302838fff47491f14fc0855287c2be
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Tue Oct 11 22:13:31 2011 +0200
get_image.js - fix for IE
commit 2a49e9fdab4bd4ec3a613c854cec755580d67a5b
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Tue Oct 11 22:12:05 2011 +0200
bugfix for Create table dialog (IE6-8, possibly fixes JS error in FF on demo server)
-----------------------------------------------------------------------
Summary of changes:
js/functions.js | 41 ++++++++++++++++++++++++++++-------------
js/get_image.js.php | 2 +-
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/js/functions.js b/js/functions.js
index ce2dac6..0ea0155 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -30,6 +30,20 @@ var codemirror_editor = false;
var chart_activeTimeouts = new Object();
/**
+ * Returns browser's viewport size, without accounting for scrollbars
+ *
+ * @param window wnd
+ */
+function getWindowSize(wnd) {
+ var vp = wnd || window;
+ return {
+ // most browsers || IE6-8 strict || failsafe
+ width: vp.innerWidth || (vp.documentElement !== undefined ?
vp.documentElement.clientWidth : false) || $(vp).width(),
+ height: vp.innerHeight || (vp.documentElement !== undefined ?
vp.documentElement.clientHeight : false) || $(vp).height()
+ };
+}
+
+/**
* Add a hidden field to the form to indicate that this will be an
* Ajax request (only if this hidden field does not exist)
*
@@ -1509,6 +1523,7 @@ function PMA_createTableDialog( div, url , target)
//remove the redundant [Back] link in the error message.
.find('fieldset').remove();
} else {
+ var size = getWindowSize();
var timeout;
div
.append(data)
@@ -1519,16 +1534,17 @@ function PMA_createTableDialog( div, url , target)
modal: true,
stack: false,
position: ['left','top'],
- width: window.innerWidth-10,
- height: window.innerHeight-10,
+ width: size.width-10,
+ height: size.height-10,
open: function() {
- var $dialog = $(this);
+ var dialog_id = $(this).attr('id');
$(window).bind('resize.dialog-resizer', function() {
clearTimeout(timeout);
timeout = setTimeout(function() {
- $dialog.dialog('option', {
- width: window.innerWidth-10,
- height: window.innerHeight-10
+ var size = getWindowSize();
+ $('#'+dialog_id).dialog('option', {
+ width: size.width-10,
+ height: size.height-10
});
}, 50);
});
@@ -1536,13 +1552,12 @@ function PMA_createTableDialog( div, url , target)
var $wrapper = $('<div>', {'id':
'content-hide'}).hide();
$('body > *:not(.ui-dialog)').wrapAll($wrapper);
- $(this).closest('.ui-dialog').css({
- left: 0,
- top: 0
- });
-
- // for Chrome
- $(this).scrollTop(0);
+ $(this)
+ .scrollTop(0) // for Chrome
+ .closest('.ui-dialog').css({
+ left: 0,
+ top: 0
+ });
PMA_verifyTypeOfAllColumns();
},
diff --git a/js/get_image.js.php b/js/get_image.js.php
index 40609d8..6064731 100644
--- a/js/get_image.js.php
+++ b/js/get_image.js.php
@@ -68,7 +68,7 @@ function PMA_getImage(image, alternate, attributes) {
// this is private
alt: '',
title: '',
- src: 'themes/dot.gif',
+ src: 'themes/dot.gif'
},
isSprite: true,
attr: function (name, value) {
hooks/post-receive
--
phpMyAdmin