Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/gridstack-poly.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
* gridstack.js may be freely distributed under the MIT license.
*/

// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

site has it wrapped in a function it calls.. maybe to scope the CustomEvent var ? I would do the same please.

Copy link
Author

@phil-blais phil-blais Mar 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. Thought the whole poly file was scoped for some reason. Updated.

(function () {
if (typeof window.CustomEvent === "function") {
return false;
}

function CustomEvent (event, params) {
params = params || {bubbles: false, cancelable: false, detail: null};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}

window.CustomEvent = CustomEvent;
})();

// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
Number.isNaN = Number.isNaN || function isNaN(input) {
return typeof input === 'number' && input !== input;
Expand Down