mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
pad_editbar: Factor out duplicate code
This commit is contained in:
parent
ee41de4809
commit
97ccf9e082
1 changed files with 2 additions and 4 deletions
|
@ -301,16 +301,14 @@ exports.padeditbar = {
|
|||
// If we're in the editbar already..
|
||||
// Close any dropdowns we have open..
|
||||
this.toggleDropDown('none');
|
||||
// Shift focus away from any drop downs
|
||||
$(':focus').blur(); // required to do not try to remove!
|
||||
// Check we're on a pad and not on the timeslider
|
||||
// Or some other window I haven't thought about!
|
||||
if (typeof pad === 'undefined') {
|
||||
// Timeslider probably..
|
||||
// Shift focus away from any drop downs
|
||||
$(':focus').blur(); // required to do not try to remove!
|
||||
$('#editorcontainerbox').focus(); // Focus back onto the pad
|
||||
} else {
|
||||
// Shift focus away from any drop downs
|
||||
$(':focus').blur(); // required to do not try to remove!
|
||||
padeditor.ace.focus(); // Sends focus back to pad
|
||||
// The above focus doesn't always work in FF, you have to hit enter afterwards
|
||||
evt.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue