mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 03:02:03 +01:00
dont use nasty settimeouts use a callback instead for focus
This commit is contained in:
parent
f9071aebe6
commit
a82e692bdd
1 changed files with 12 additions and 14 deletions
|
@ -352,32 +352,30 @@ var padeditbar = (function()
|
||||||
toolbar.registerDropdownCommand("embed");
|
toolbar.registerDropdownCommand("embed");
|
||||||
|
|
||||||
toolbar.registerCommand("settings", function () {
|
toolbar.registerCommand("settings", function () {
|
||||||
setTimeout(function(){
|
toolbar.toggleDropDown("settings", function(){
|
||||||
$('#options-stickychat').focus();
|
$('#options-stickychat').focus();
|
||||||
},100);
|
});
|
||||||
toolbar.toggleDropDown("settings");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toolbar.registerCommand("import_export", function () {
|
toolbar.registerCommand("import_export", function () {
|
||||||
setTimeout(function(){
|
toolbar.toggleDropDown("import_export", function(){
|
||||||
$('#importfileinput').focus();
|
setTimeout(function(){
|
||||||
},100);
|
$('#importfileinput').focus();
|
||||||
toolbar.toggleDropDown("import_export");
|
}, 100);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
toolbar.registerCommand("showusers", function () {
|
toolbar.registerCommand("showusers", function () {
|
||||||
setTimeout(function(){
|
toolbar.toggleDropDown("users", function(){
|
||||||
$('#myusernameedit').focus(); // TODO: Not working
|
$('#myusernameedit').focus();
|
||||||
},100);
|
});
|
||||||
toolbar.toggleDropDown("users");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toolbar.registerCommand("embed", function () {
|
toolbar.registerCommand("embed", function () {
|
||||||
toolbar.setEmbedLinks();
|
toolbar.setEmbedLinks();
|
||||||
setTimeout(function(){
|
toolbar.toggleDropDown("embed", function(){
|
||||||
$('#linkinput').focus().select();
|
$('#linkinput').focus().select();
|
||||||
}, 100);
|
});
|
||||||
toolbar.toggleDropDown("embed");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toolbar.registerCommand("savedRevision", function () {
|
toolbar.registerCommand("savedRevision", function () {
|
||||||
|
|
Loading…
Reference in a new issue