Fix input losing focus in polls with Chrome 57

pull/1/head
yflory 8 years ago
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) {
console.log('push', href);
files[UNSORTED].push(href);
}
};

@ -238,22 +238,40 @@ define([
*/
notify();
if (throttle) {
if (APP.throttled) { window.clearTimeout(APP.throttled); }
var getFocus = function () {
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 f = getFocus();
Render.updateTable(table, displayedObj2, conf);
updateDisplayedTable();
setFocus(f);
};
if (throttle) {
if (APP.throttled) { window.clearTimeout(APP.throttled); }
updateTable();
APP.throttled = window.setTimeout(function () {
updateDisplayedTable();
}, throttle);
return;
}
window.setTimeout(function () {
var displayedObj2 = mergeUncommitted(APP.proxy, APP.uncommitted);
Render.updateTable(table, displayedObj2, conf);
updateDisplayedTable();
});
window.setTimeout(updateTable);
};
var getRealtimeId = function (input) {

Loading…
Cancel
Save