assets/javascripts/bootstrap/popover.js in bootstrap-4.0.0.beta3 vs assets/javascripts/bootstrap/popover.js in bootstrap-4.0.0

- old
+ new

@@ -6,22 +6,22 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-beta.3): popover.js + * Bootstrap (v4.0.0): popover.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ var Popover = function ($) { /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ var NAME = 'popover'; - var VERSION = '4.0.0-beta.3'; + var VERSION = '4.0.0'; var DATA_KEY = 'bs.popover'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var CLASS_PREFIX = 'bs-popover'; var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); @@ -73,11 +73,11 @@ return _Tooltip.apply(this, arguments) || this; } var _proto = Popover.prototype; - // overrides + // Overrides _proto.isWithContent = function isWithContent() { return this.getTitle() || this._getContent(); }; _proto.addAttachmentClass = function addAttachmentClass(attachment) { @@ -88,11 +88,11 @@ this.tip = this.tip || $(this.config.template)[0]; return this.tip; }; _proto.setContent = function setContent() { - var $tip = $(this.getTipElement()); // we use append for html objects to maintain js events + var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); var content = this._getContent(); @@ -100,11 +100,11 @@ content = content.call(this.element); } this.setElementContent($tip.find(Selector.CONTENT), content); $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW); - }; // private + }; // Private _proto._getContent = function _getContent() { return this.element.getAttribute('data-content') || this.config.content; }; @@ -114,11 +114,11 @@ var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); if (tabClass !== null && tabClass.length > 0) { $tip.removeClass(tabClass.join('')); } - }; // static + }; // Static Popover._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY); @@ -134,20 +134,20 @@ $(this).data(DATA_KEY, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { - throw new Error("No method named \"" + config + "\""); + throw new TypeError("No method named \"" + config + "\""); } data[config](); } }); }; _createClass(Popover, null, [{ key: "VERSION", - // getters + // Getters get: function get() { return VERSION; } }, { key: "Default",