diff options
author | Mark Otto <markdotto@gmail.com> | 2017-09-06 07:05:12 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2017-09-06 07:05:12 +0300 |
commit | df47558ef680adf6e80b5e8402837125c41210c0 (patch) | |
tree | fb9cb52d3ed467f73c16140254b18e9733e640ab /js/dist/popover.js | |
parent | fbd1f52f896c599211c24c5c86d04fbbb3e88165 (diff) |
dist
Diffstat (limited to 'js/dist/popover.js')
-rw-r--r-- | js/dist/popover.js | 118 |
1 files changed, 66 insertions, 52 deletions
diff --git a/js/dist/popover.js b/js/dist/popover.js index 901fc87cb9..b20459c2c3 100644 --- a/js/dist/popover.js +++ b/js/dist/popover.js @@ -1,3 +1,5 @@ +'use strict'; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -15,7 +17,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * -------------------------------------------------------------------------- */ -var Popover = function ($) { +var Popover = function () { /** * ------------------------------------------------------------------------ @@ -77,73 +79,85 @@ var Popover = function ($) { function Popover() { _classCallCheck(this, Popover); - return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments)); + return _possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).apply(this, arguments)); } - // overrides - - Popover.prototype.isWithContent = function isWithContent() { - return this.getTitle() || this._getContent(); - }; - - Popover.prototype.addAttachmentClass = function addAttachmentClass(attachment) { - $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); - }; + _createClass(Popover, [{ + key: 'isWithContent', - Popover.prototype.getTipElement = function getTipElement() { - return this.tip = this.tip || $(this.config.template)[0]; - }; - Popover.prototype.setContent = function setContent() { - var $tip = $(this.getTipElement()); + // overrides - // we use append for html objects to maintain js events - this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); - this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); + value: function isWithContent() { + return this.getTitle() || this._getContent(); + } + }, { + key: 'addAttachmentClass', + value: function addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + this.tip = this.tip || $(this.config.template)[0]; + return this.tip; + } + }, { + key: 'setContent', + value: function setContent() { + var $tip = $(this.getTipElement()); - $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); - }; + // we use append for html objects to maintain js events + this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); + this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); - // private + $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); + } - Popover.prototype._getContent = function _getContent() { - return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); - }; + // private - Popover.prototype._cleanTipClass = function _cleanTipClass() { - var $tip = $(this.getTipElement()); - var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); - if (tabClass !== null && tabClass.length > 0) { - $tip.removeClass(tabClass.join('')); + }, { + key: '_getContent', + value: function _getContent() { + return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); + } + }, { + key: '_cleanTipClass', + value: function _cleanTipClass() { + var $tip = $(this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')); + } } - }; - - // static - Popover._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; + // static - if (!data && /destroy|hide/.test(config)) { - return; - } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; - if (!data) { - data = new Popover(this, _config); - $(this).data(DATA_KEY, data); - } + if (!data && /destroy|hide/.test(config)) { + return; + } - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); } - data[config](); - } - }); - }; - _createClass(Popover, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', |