summaryrefslogtreecommitdiff
path: root/lib/scripts/toolbar.js
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-10-17 20:03:29 +0200
committerAndreas Gohr <andi@splitbrain.org>2009-10-17 20:03:29 +0200
commit8cc02d2f62a570ffd365bfbefdbbafb0189443f1 (patch)
treeabf1b6510c6bff224674065291ba8b6f6f47474b /lib/scripts/toolbar.js
parent31f197d78fc3c5a2cd03542e07f1dda69f15a630 (diff)
downloadrpg-8cc02d2f62a570ffd365bfbefdbbafb0189443f1.tar.gz
rpg-8cc02d2f62a570ffd365bfbefdbbafb0189443f1.tar.bz2
Some JS cleanup, keep accesskeys working for hidden pickers FS#1761
Ignore-this: 3b6c8568615d24be7115adf8570f56bd darcs-hash:20091017180329-7ad00-9ff4a12c811f1a4c63e473dc6665928fda720850.gz
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r--lib/scripts/toolbar.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js
index 15f1f96ca..c2c286830 100644
--- a/lib/scripts/toolbar.js
+++ b/lib/scripts/toolbar.js
@@ -158,6 +158,15 @@ function addBtnActionPicker(btn, props, edid) {
return true;
}
+/**
+ * Add button action for the link wizard button
+ *
+ * @param DOMElement btn Button element to add the action to
+ * @param array props Associative array of button properties
+ * @param string edid ID of the editor textarea
+ * @return boolean If button should be appended
+ * @author Andreas Gohr <gohr@cosmocode.de>
+ */
function addBtnActionLinkwiz(btn, props, edid) {
linkwiz.init($(edid));
addEvent(btn,'click',function(){
@@ -167,7 +176,6 @@ function addBtnActionLinkwiz(btn, props, edid) {
return true;
}
-
/**
* Show/Hide a previosly created picker window
*
@@ -175,14 +183,13 @@ function addBtnActionLinkwiz(btn, props, edid) {
*/
function pickerToggle(pickerid,btn){
var picker = $(pickerid);
- if(picker.style.display == 'none'){
+ if(picker.style.left == '-10000px'){
var x = findPosX(btn);
var y = findPosY(btn);
- picker.style.display = 'block';
picker.style.left = (x+3)+'px';
picker.style.top = (y+btn.offsetHeight+3)+'px';
}else{
- picker.style.display = 'none';
+ picker.style.left = '-10000px';
}
}
@@ -194,7 +201,7 @@ function pickerToggle(pickerid,btn){
function pickerClose(){
var pobjs = getElementsByClass('picker');
for(var i=0; i<pobjs.length; i++){
- pobjs[i].style.display = 'none';
+ pobjs[i].style.left = '-10000px';
}
}