Fix input losing focus in polls with Chrome 57
This commit is contained in:
parent
a5e5ddae08
commit
a9777ce560
@ -948,7 +948,6 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (unsortedFiles.indexOf(href) === -1 && rootFiles.indexOf(href) === -1 && templateFiles.indexOf(href) === -1 && trashFiles.indexOf(href) === -1) {
|
if (unsortedFiles.indexOf(href) === -1 && rootFiles.indexOf(href) === -1 && templateFiles.indexOf(href) === -1 && trashFiles.indexOf(href) === -1) {
|
||||||
console.log('push', href);
|
|
||||||
files[UNSORTED].push(href);
|
files[UNSORTED].push(href);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -238,22 +238,40 @@ define([
|
|||||||
*/
|
*/
|
||||||
notify();
|
notify();
|
||||||
|
|
||||||
if (throttle) {
|
var getFocus = function () {
|
||||||
if (APP.throttled) { window.clearTimeout(APP.throttled); }
|
var active = document.activeElement;
|
||||||
|
if (!active) { return; }
|
||||||
|
return {
|
||||||
|
el: active,
|
||||||
|
start: active.selectionStart,
|
||||||
|
end: active.selectionEnd
|
||||||
|
};
|
||||||
|
};
|
||||||
|
var setFocus = function (obj) {
|
||||||
|
if (obj.el) { obj.el.focus(); }
|
||||||
|
else { return; }
|
||||||
|
if (obj.start) { obj.el.selectionStart = obj.start; }
|
||||||
|
if (obj.end) { obj.el.selectionEnd = obj.end; }
|
||||||
|
};
|
||||||
|
|
||||||
|
var updateTable = function () {
|
||||||
var displayedObj2 = mergeUncommitted(APP.proxy, APP.uncommitted);
|
var displayedObj2 = mergeUncommitted(APP.proxy, APP.uncommitted);
|
||||||
|
var f = getFocus();
|
||||||
Render.updateTable(table, displayedObj2, conf);
|
Render.updateTable(table, displayedObj2, conf);
|
||||||
updateDisplayedTable();
|
updateDisplayedTable();
|
||||||
|
setFocus(f);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (throttle) {
|
||||||
|
if (APP.throttled) { window.clearTimeout(APP.throttled); }
|
||||||
|
updateTable();
|
||||||
APP.throttled = window.setTimeout(function () {
|
APP.throttled = window.setTimeout(function () {
|
||||||
updateDisplayedTable();
|
updateDisplayedTable();
|
||||||
}, throttle);
|
}, throttle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.setTimeout(function () {
|
window.setTimeout(updateTable);
|
||||||
var displayedObj2 = mergeUncommitted(APP.proxy, APP.uncommitted);
|
|
||||||
Render.updateTable(table, displayedObj2, conf);
|
|
||||||
updateDisplayedTable();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var getRealtimeId = function (input) {
|
var getRealtimeId = function (input) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user