UNPKG

ztech_jquery_ext

Version:

Extends JQuery library for more compact code base

10 lines 1.82 kB
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /*! * ztech_jquery_ext 0.0.1 * Extends JQuery library for more compact code base * * Created by Ivan Auda * * @license MIT */ !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(o){var r={myStyle:"my-style1"},i=function(){function n(e,t){_classCallCheck(this,n),this.options=o.extend(!0,{},r,t),this.$ele=o(e),this._init()}return _createClass(n,[{key:"_init",value:function(){}}]),n}();o.fn.$arr=function(){return this.toArray().map(function(e){return o(e)})},o.fn.$map=function(e){return this.$arr().map(e)},o.fn.ztechExt=function(e){var t,n="ztechExt";return void 0===e||"object"===_typeof(e)?this.each(function(){o.data(this,n)||o.data(this,n,new i(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(t=o.data(this[0],n),"destroy"===e&&o.data(this,n,null),t instanceof i&&"function"==typeof t[e]?t[e].apply(t,Array.prototype.slice.call(arguments,1)):this):void 0}});