UNPKG

@antv/x6

Version:

JavaScript diagramming library that uses SVG and HTML for rendering.

59 lines 2.33 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var jquery_1 = __importDefault(require("jquery")); require("jquery-mousewheel"); var platform_1 = require("../platform"); if (platform_1.Platform.SUPPORT_PASSIVE) { jquery_1.default.event.special.touchstart = { setup: function (data, ns, handle) { this.addEventListener('touchstart', handle, { passive: true, }); }, }; var hook = jquery_1.default.event.special.mousewheel; if (hook) { var setup_1 = hook.setup; hook.setup = function () { var _this = this; var addEventListener = this.addEventListener; this.addEventListener = function (name, handler) { addEventListener.call(_this, name, handler, { passive: true }); }; setup_1.call(this); this.addEventListener = addEventListener; }; } } // compatible with NodeList.prototype.forEach() before chrome 51 // https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach; } // compatible with ParentNode.append() before chrome 54 // https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('append')) { return; } Object.defineProperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argArr = Array.prototype.slice.call(arguments); var docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); this.appendChild(docFrag); }, }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); //# sourceMappingURL=index.js.map