mirror of
https://github.com/vrana/adminer.git
synced 2025-08-21 05:41:27 +02:00
Fix saving schema to cookie in Opera and Firefox 4
This commit is contained in:
@@ -397,8 +397,9 @@ function schemaMousemove(ev) {
|
||||
|
||||
/** Finish move
|
||||
* @param MouseEvent
|
||||
* @param string
|
||||
*/
|
||||
function schemaMouseup(ev) {
|
||||
function schemaMouseup(ev, db) {
|
||||
if (that !== undefined) {
|
||||
ev = ev || event;
|
||||
tablePos[that.firstChild.firstChild.firstChild.data] = [ (ev.clientY - y) / em, (ev.clientX - x) / em ];
|
||||
@@ -410,6 +411,6 @@ function schemaMouseup(ev) {
|
||||
s = encodeURIComponent(s.substr(1));
|
||||
var link = document.getElementById('schema-link');
|
||||
link.href = link.href.replace(/[^=]+$/, '') + s;
|
||||
cookie('adminer_schema=' + s, 30, '; path="' + location.pathname + location.search + '"');
|
||||
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
|
||||
}
|
||||
}
|
||||
|
@@ -16,10 +16,10 @@ function toggle(id) {
|
||||
* @param number
|
||||
* @param string optional
|
||||
*/
|
||||
function cookie(assign, days, params) {
|
||||
function cookie(assign, days) {
|
||||
var date = new Date();
|
||||
date.setDate(date.getDate() + days);
|
||||
document.cookie = assign + '; expires=' + date + (params || '');
|
||||
document.cookie = assign + '; expires=' + date;
|
||||
}
|
||||
|
||||
/** Verify current Adminer version
|
||||
|
Reference in New Issue
Block a user