Skip to content
Snippets Groups Projects
Commit c633fbb9 authored by Ivana Yovcheva's avatar Ivana Yovcheva Committed by Alex Ellis
Browse files

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: default avatarIvana Yovcheva <iyovcheva@vmware.com>
parent 0f126ce2
No related branches found
No related tags found
No related merge requests found
......@@ -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", {
"view": window,
"bubbles": true,
"cancelable": false
});
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment