mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-29 11:31:19 +01:00
Fix Page Editor textarea always being focused after saving/reloading
This commit is contained in:
parent
98e5fe7923
commit
96466eece4
@ -193,7 +193,11 @@ Formwork.Editor = function(id) {
|
||||
|
||||
function retainCursorPosition() {
|
||||
var data = [location.pathname, textarea.scrollTop, textarea.selectionEnd].join('#');
|
||||
window.sessionStorage.setItem('formworkEditorCursorPosition', data);
|
||||
if ($(textarea).is(':focus')) {
|
||||
window.sessionStorage.setItem('formworkEditorCursorPosition', data);
|
||||
} else {
|
||||
window.sessionStorage.removeItem('formworkEditorCursorPosition');
|
||||
}
|
||||
}
|
||||
|
||||
function restoreCursorPosition() {
|
||||
|
2
admin/assets/js/app.min.js
vendored
2
admin/assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -98,7 +98,11 @@ Formwork.Editor = function(id) {
|
||||
|
||||
function retainCursorPosition() {
|
||||
var data = [location.pathname, textarea.scrollTop, textarea.selectionEnd].join('#');
|
||||
window.sessionStorage.setItem('formworkEditorCursorPosition', data);
|
||||
if ($(textarea).is(':focus')) {
|
||||
window.sessionStorage.setItem('formworkEditorCursorPosition', data);
|
||||
} else {
|
||||
window.sessionStorage.removeItem('formworkEditorCursorPosition');
|
||||
}
|
||||
}
|
||||
|
||||
function restoreCursorPosition() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user