mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
Removed more IE workarounds from knockoutjs
This commit is contained in:
parent
9241726ffe
commit
118c1613a4
12 changed files with 160 additions and 455 deletions
33
vendors/knockout/src/tasks.js
vendored
33
vendors/knockout/src/tasks.js
vendored
|
|
@ -5,32 +5,13 @@ ko.tasks = (function () {
|
|||
nextHandle = 1,
|
||||
nextIndexToProcess = 0;
|
||||
|
||||
if (window['MutationObserver']) {
|
||||
// Chrome 27+, Firefox 14+, IE 11+, Opera 15+, Safari 6.1+
|
||||
// From https://github.com/petkaantonov/bluebird * Copyright (c) 2014 Petka Antonov * License: MIT
|
||||
scheduler = (function (callback) {
|
||||
var div = document.createElement("div");
|
||||
new MutationObserver(callback).observe(div, {attributes: true});
|
||||
return function () { div.classList.toggle("foo"); };
|
||||
})(scheduledProcess);
|
||||
} else if (document && "onreadystatechange" in document.createElement("script")) {
|
||||
// IE 6-10
|
||||
// From https://github.com/YuzuJS/setImmediate * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola * License: MIT
|
||||
scheduler = function (callback) {
|
||||
var script = document.createElement("script");
|
||||
script.onreadystatechange = function () {
|
||||
script.onreadystatechange = null;
|
||||
document.documentElement.removeChild(script);
|
||||
script = null;
|
||||
callback();
|
||||
};
|
||||
document.documentElement.append(script);
|
||||
};
|
||||
} else {
|
||||
scheduler = function (callback) {
|
||||
setTimeout(callback, 0);
|
||||
};
|
||||
}
|
||||
// Chrome 27+, Firefox 14+, IE 11+, Opera 15+, Safari 6.1+
|
||||
// From https://github.com/petkaantonov/bluebird * Copyright (c) 2014 Petka Antonov * License: MIT
|
||||
scheduler = (function (callback) {
|
||||
var div = document.createElement("div");
|
||||
new MutationObserver(callback).observe(div, {attributes: true});
|
||||
return function () { div.classList.toggle("foo"); };
|
||||
})(scheduledProcess);
|
||||
|
||||
function processTasks() {
|
||||
if (taskQueueLength) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue