summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-09-19 07:36:50 +0000
committeralecpl <alec@alec.pl>2008-09-19 07:36:50 +0000
commit80c6786807d9d136938f4dd06ff3e976f4f2533e (patch)
treecf4fa1888d12193c7ecd594d0bdbe2156b7ce479
parentd4273b8990d56394623e713a0696ec27545bccc7 (diff)
- make setting/reading splitter's cookie simpler (we need only position number in it)
-rw-r--r--skins/default/splitter.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/skins/default/splitter.js b/skins/default/splitter.js
index 4391ae9fe..ef4da037b 100644
--- a/skins/default/splitter.js
+++ b/skins/default/splitter.js
@@ -49,16 +49,9 @@ function rcube_splitter(attrib)
// read saved position from cookie
var cookie = bw.get_cookie(this.id);
- if (cookie)
+ if (cookie && !isNaN(cookie))
{
- var param = cookie.split(':');
-
- for (var i=0, p; i<param.length; i++)
- {
- p = param[i].split('=');
- this[p[0]] = !isNaN(p[1]) ? parseFloat(p[1]) : p[1];
- }
-
+ this.pos = parseFloat(cookie);
this.resize();
}
else if (this.pos)
@@ -238,7 +231,7 @@ function rcube_splitter(attrib)
// save state in cookie
var exp = new Date();
exp.setYear(exp.getFullYear() + 1);
- bw.set_cookie(this.id, 'pos='+this.pos, exp);
+ bw.set_cookie(this.id, this.pos, exp);
}
} // end class rcube_splitter