mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
Revert change to focus on padeditor.ace
This commit is contained in:
parent
d1fd315c86
commit
17ac7cf8ff
3 changed files with 7 additions and 6 deletions
|
@ -227,7 +227,7 @@ exports.chat = (() => {
|
||||||
if ((evt.altKey === true && evt.which === 67) || evt.which === 27) {
|
if ((evt.altKey === true && evt.which === 67) || evt.which === 27) {
|
||||||
// If we're in chat already..
|
// If we're in chat already..
|
||||||
$(':focus').trigger('blur'); // required to do not try to remove!
|
$(':focus').trigger('blur'); // required to do not try to remove!
|
||||||
padeditor.ace.trigger('focus'); // Sends focus back to pad
|
padeditor.ace.focus(); // Sends focus back to pad
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,13 +410,14 @@ const pad = {
|
||||||
const postAceInit = () => {
|
const postAceInit = () => {
|
||||||
padeditbar.init();
|
padeditbar.init();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
padeditor.ace.trigger('focus');
|
padeditor.ace.focus();
|
||||||
}, 0);
|
}, 0);
|
||||||
$('#options-stickychat').on('click', () => { chat.stickToScreen(); });
|
const optionsStickyChat = $('#options-stickychat');
|
||||||
|
optionsStickyChat.on('click', () => { chat.stickToScreen(); });
|
||||||
// if we have a cookie for always showing chat then show it
|
// if we have a cookie for always showing chat then show it
|
||||||
if (padcookie.getPref('chatAlwaysVisible')) {
|
if (padcookie.getPref('chatAlwaysVisible')) {
|
||||||
chat.stickToScreen(true); // stick it to the screen
|
chat.stickToScreen(true); // stick it to the screen
|
||||||
$('#options-stickychat').prop('checked', true); // set the checkbox to on
|
optionsStickyChat.prop('checked', true); // set the checkbox to on
|
||||||
}
|
}
|
||||||
// if we have a cookie for always showing chat then show it
|
// if we have a cookie for always showing chat then show it
|
||||||
if (padcookie.getPref('chatAndUsers')) {
|
if (padcookie.getPref('chatAndUsers')) {
|
||||||
|
|
|
@ -201,7 +201,7 @@ exports.padeditbar = new class {
|
||||||
if (this.isEnabled() && this.commands[cmd]) {
|
if (this.isEnabled() && this.commands[cmd]) {
|
||||||
this.commands[cmd](cmd, padeditor.ace, item);
|
this.commands[cmd](cmd, padeditor.ace, item);
|
||||||
}
|
}
|
||||||
if (padeditor.ace) padeditor.ace.trigger('focus');
|
if (padeditor.ace) padeditor.ace.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
// cb is deprecated (this function is synchronous so a callback is unnecessary).
|
// cb is deprecated (this function is synchronous so a callback is unnecessary).
|
||||||
|
@ -312,7 +312,7 @@ exports.padeditbar = new class {
|
||||||
// Timeslider probably..
|
// Timeslider probably..
|
||||||
$('#editorcontainerbox').trigger('focus'); // Focus back onto the pad
|
$('#editorcontainerbox').trigger('focus'); // Focus back onto the pad
|
||||||
} else {
|
} else {
|
||||||
padeditor.ace.trigger('focus'); // Sends focus back to pad
|
padeditor.ace.focus(); // Sends focus back to pad
|
||||||
// The above focus doesn't always work in FF, you have to hit enter afterwards
|
// The above focus doesn't always work in FF, you have to hit enter afterwards
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue