-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.es2015.min.js
12 lines (11 loc) · 2.48 KB
/
controller.es2015.min.js
1
2
3
4
5
6
7
8
9
10
11
12
/**
* GpsLab Controller
* https://github.com/gpslab/gpslab-controller
*
* Copyright 2019 by Peter Gribanov (http://peter-gribanov.ru)
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
!function(){function n(e,t,r){function o(u,f){if(!t[u]){if(!e[u]){var l="function"==typeof require&&require;if(!f&&l)return l(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var a=t[u]={exports:{}};e[u][0].call(a.exports,function(n){return o(e[u][1][n]||n)},a,a.exports,n,e,t,r)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}return n}()({1:[function(n,e,t){"use strict";function r(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i=function(){function n(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();!function(n,e){n.Controller=e()}("undefined"!=typeof window?window:void 0,function(){var n=[];return function(){function e(){r(this,e)}return i(e,null,[{key:"register",value:function(){document.addEventListener("DOMContentLoaded",function(){e.bind(document.getElementsByTagName("body").item(0))})}},{key:"registerControl",value:function(e,t){return"function"==typeof t&&(n[e]=t,!0)}},{key:"registerControls",value:function(n){for(var t in n){if(!n.hasOwnProperty(t))return!1;e.registerControl(t,n[t])}return!0}},{key:"singleBind",value:function(e){if(!(e instanceof Element))throw new Error("The element to be binding must be instance of Element, now it's \""+(void 0===e?"undefined":o(e))+'".');if(!e.getAttribute("data-control"))return!1;for(var t=e.getAttribute("data-control").replace(/[, ]+/g," ").split(" "),r=!1,i=0;i<t.length;i++)"function"==typeof n[t[i]]&&(n[t[i]](e),r=!0);return r}},{key:"bind",value:function(n){if(!(n instanceof Element))throw new Error("The element to be binding must be instance of Element, now it's \""+(void 0===n?"undefined":o(n))+'".');for(var t=e.singleBind(n),r=n.querySelectorAll("[data-control]"),i=0;i<r.length;i++)!function(n){e.singleBind(n),t=!0}(r[i]);return t}}]),e}()})},{}]},{},[1]);
//# sourceMappingURL=controller.es2015.min.js.map