aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/toolbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r--lib/scripts/toolbar.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js
index 6beb07c5b..c8dfe394d 100644
--- a/lib/scripts/toolbar.js
+++ b/lib/scripts/toolbar.js
@@ -18,12 +18,12 @@ function initToolbar(tbid,edid,tb, allowblock){
} else {
var toolbar = $(tbid);
}
-
+
if(toolbar.length == 0) return;
-
+
var edit = $('#' + edid);
if(edit.length == 0) return;
-
+
if(edit.attr('readOnly')) return;
if (typeof allowblock === 'undefined') {
@@ -33,41 +33,41 @@ function initToolbar(tbid,edid,tb, allowblock){
//empty the toolbar area:
toolbar.html('');
- var cnt = tb.length;
-
+ var cnt = tb.length;
+
for(var i=0; i<cnt; i++){
if (!allowblock && tb[i].block === true) {
continue;
}
var actionFunc;
-
+
// create new button (jQuery object)
var btn = $(createToolButton(tb[i]['icon'],
tb[i]['title'],
tb[i]['key'],
tb[i]['id'],
tb[i]['class']));
-
+
// type is a tb function -> assign it as onclick
actionFunc = 'tb_'+tb[i]['type'];
if( $.isFunction(window[actionFunc]) ){
- btn.bind('click', bind(window[actionFunc],btn,tb[i],edid) );
+ btn.bind('click', bind(window[actionFunc],btn,tb[i],edid) );
toolbar.append(btn);
continue;
}
-
+
// type is a init function -> execute it
actionFunc = 'addBtnAction'+tb[i]['type'].charAt(0).toUpperCase()+tb[i]['type'].substring(1);
if( $.isFunction(window[actionFunc]) ){
if(window[actionFunc](btn, tb[i], edid)){
toolbar.append(btn);
- }
+ }
continue;
}
-
+
alert('unknown toolbar type: '+tb[i]['type']+' '+actionFunc);
} // end for
-
+
}
/**
@@ -205,7 +205,7 @@ function tb_autohead(btn, props, edid){
function addBtnActionPicker(btn, props, edid) {
var pickerid = 'picker'+(pickercounter++);
createPicker(pickerid, props, edid);
-
+
btn.click(
function() {
pickerToggle(pickerid,btn);
@@ -240,7 +240,7 @@ function pickerToggle(pickerid,btn){
if (picker.css('marginLeft') == '-10000px'){
var x = findPosX(btn[0]);
var y = findPosY(btn[0]);
-
+
picker.css('left',(x+3)+'px')
.css('top', (y+btn[0].offsetHeight+3)+'px')
.css('marginLeft', '0px')