mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
Fix mouse click error on IE11
MouseEvent initialization was failing on IE11. Add a separate case for IE11 that fixes the issue. Signed-off-by: Ivana Yovcheva <iyovcheva@vmware.com>
This commit is contained in:
parent
0f126ce241
commit
c633fbb96d
21
gateway/assets/script/bootstrap.js
vendored
21
gateway/assets/script/bootstrap.js
vendored
@ -96,11 +96,30 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
|
||||
linkElement.setAttribute('href', url);
|
||||
linkElement.setAttribute("download", filename);
|
||||
|
||||
var clickEvent = new MouseEvent("click", {
|
||||
var clickEvent;
|
||||
|
||||
if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) { // for IE 11
|
||||
clickEvent = document.createEvent("MouseEvent");
|
||||
|
||||
clickEvent.initMouseEvent("click", /* eventName */
|
||||
true, /* bubbles */
|
||||
false, /* cancelable */
|
||||
window, /* view */
|
||||
0,0,0,0,0, /* detail, screenX, screenY, clientX, clientY */
|
||||
false, /* ctrlKey */
|
||||
false, /* altKey */
|
||||
false, /* shiftKey */
|
||||
false, /* metaKey */
|
||||
0, /* button */
|
||||
null /* relatedTarget */
|
||||
);
|
||||
} else {
|
||||
clickEvent = new MouseEvent("click", {
|
||||
"view": window,
|
||||
"bubbles": true,
|
||||
"cancelable": false
|
||||
});
|
||||
}
|
||||
linkElement.dispatchEvent(clickEvent);
|
||||
} catch (ex) {
|
||||
caught = ex;
|
||||
|
Loading…
x
Reference in New Issue
Block a user