Lean-Mean-Drag-and-Drop
Lean-Mean-Drag-and-Drop copied to clipboard
Library doesn't work in Internet Explorer
While using demos in Internet Explorer, library throws error Object doesn't support this action. This error caused by below snippet.
scope.dispatchEvent(new CustomEvent('lmddbeforestart', {'bubbles': true}))
.
Reported error is coming because for IE versions >= 9, custom events must be created using document.createEvent() and then initialized using the initCustomEvent method of the previously created event.
So after doing stackoverflow I found we can fix this issue by adding below pollyfill provided by mozila firefox.
(function () {
if ( typeof window.CustomEvent === "function" ) return false;
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();