mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
bugfix / testing: Ie11 warning for not having Promises (#4167)
Makes IE11 work again but may cause an issue for plugin testing in IE11. IE plugin tests in IE11 will probably fail as the plugin code will not execute.
This commit is contained in:
parent
e24ef6969e
commit
9bf1b9f2a2
1 changed files with 9 additions and 4 deletions
|
@ -96,11 +96,16 @@ function aCallAll(hook_name, args, cb) {
|
|||
/* return a Promise if cb is not supplied */
|
||||
exports.aCallAll = function (hook_name, args, cb) {
|
||||
if (cb === undefined) {
|
||||
try{
|
||||
return new Promise(function(resolve, reject) {
|
||||
aCallAll(hook_name, args, function(err, res) {
|
||||
return err ? reject(err) : resolve(res);
|
||||
});
|
||||
});
|
||||
}catch(e){
|
||||
$.gritter.removeAll();
|
||||
$.gritter.add("Please update your web browser")
|
||||
}
|
||||
} else {
|
||||
return aCallAll(hook_name, args, cb);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue