assets/javascripts/materialize/tapTarget.js in materialize-sass-1.0.0.alpha4 vs assets/javascripts/materialize/tapTarget.js in materialize-sass-1.0.0.beta

- old
+ new

@@ -19,33 +19,33 @@ /** * @class * */ - var FeatureDiscovery = function (_Component) { - _inherits(FeatureDiscovery, _Component); + var TapTarget = function (_Component) { + _inherits(TapTarget, _Component); /** - * Construct FeatureDiscovery instance + * Construct TapTarget instance * @constructor * @param {Element} el * @param {Object} options */ - function FeatureDiscovery(el, options) { - _classCallCheck(this, FeatureDiscovery); + function TapTarget(el, options) { + _classCallCheck(this, TapTarget); - var _this = _possibleConstructorReturn(this, (FeatureDiscovery.__proto__ || Object.getPrototypeOf(FeatureDiscovery)).call(this, FeatureDiscovery, el, options)); + var _this = _possibleConstructorReturn(this, (TapTarget.__proto__ || Object.getPrototypeOf(TapTarget)).call(this, TapTarget, el, options)); - _this.el.M_FeatureDiscovery = _this; + _this.el.M_TapTarget = _this; /** * Options for the select - * @member FeatureDiscovery#options + * @member TapTarget#options * @prop {Function} onOpen - Callback function called when feature discovery is opened * @prop {Function} onClose - Callback function called when feature discovery is closed */ - _this.options = $.extend({}, FeatureDiscovery.defaults, options); + _this.options = $.extend({}, TapTarget.defaults, options); _this.isOpen = false; // setup _this.$origin = $('#' + _this.$el.attr('data-target')); @@ -54,20 +54,20 @@ _this._calculatePositioning(); _this._setupEventHandlers(); return _this; } - _createClass(FeatureDiscovery, [{ + _createClass(TapTarget, [{ key: 'destroy', /** * Teardown component */ value: function destroy() { this._removeEventHandlers(); - this.el.FeatureDiscovery = undefined; + this.el.TapTarget = undefined; } /** * Setup Event Handlers */ @@ -148,11 +148,11 @@ e.stopPropagation(); } } /** - * Setup feature discovery + * Setup Tap Target */ }, { key: '_setup', value: function _setup() { @@ -284,11 +284,11 @@ height: tapTargetWaveHeight + 'px' }); } /** - * Open Feature Discovery + * Open TapTarget */ }, { key: 'open', value: function open() { @@ -307,11 +307,11 @@ document.body.addEventListener('click', this._handleDocumentClickBound, true); document.body.addEventListener('touchend', this._handleDocumentClickBound); } /** - * Close Feature Discovery + * Close Tap Target */ }, { key: 'close', value: function close() { @@ -331,34 +331,34 @@ document.body.removeEventListener('touchend', this._handleDocumentClickBound); } }], [{ key: 'init', value: function init(els, options) { - return _get(FeatureDiscovery.__proto__ || Object.getPrototypeOf(FeatureDiscovery), 'init', this).call(this, this, els, options); + return _get(TapTarget.__proto__ || Object.getPrototypeOf(TapTarget), 'init', this).call(this, this, els, options); } /** * Get Instance */ }, { key: 'getInstance', value: function getInstance(el) { var domElem = !!el.jquery ? el[0] : el; - return domElem.M_FeatureDiscovery; + return domElem.M_TapTarget; } }, { key: 'defaults', get: function () { return _defaults; } }]); - return FeatureDiscovery; + return TapTarget; }(Component); - M.FeatureDiscovery = FeatureDiscovery; + M.TapTarget = TapTarget; if (M.jQueryLoaded) { - M.initializeJqueryWrapper(FeatureDiscovery, 'featureDiscovery', 'M_FeatureDiscovery'); + M.initializeJqueryWrapper(TapTarget, 'tapTarget', 'M_TapTarget'); } })(cash);