tooltip.js 16.3 KB
Newer Older
Mark Otto's avatar
grunt    
Mark Otto committed
1
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; };
XhmikosR's avatar
XhmikosR committed
2

Mark Otto's avatar
grunt    
Mark Otto committed
3
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; }; }();
4

Mark Otto's avatar
grunt    
Mark Otto committed
5
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
7
8

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
9
 * Bootstrap (v4.0.0-alpha.4): tooltip.js
10
11
12
13
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
grunt    
Mark Otto committed
14
var Tooltip = function ($) {
15

16
17
  /**
   * Check for Tether dependency
Mark Otto's avatar
grunt    
Mark Otto committed
18
   * Tether - http://tether.io/
19
   */
XhmikosR's avatar
XhmikosR committed
20
  if (window.Tether === undefined) {
Mark Otto's avatar
grunt    
Mark Otto committed
21
    throw new Error('Bootstrap tooltips require Tether (http://tether.io/)');
22
23
  }

24
25
26
27
28
29
30
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'tooltip';
Mark Otto's avatar
Mark Otto committed
31
  var VERSION = '4.0.0-alpha.4';
32
  var DATA_KEY = 'bs.tooltip';
fat's avatar
fat committed
33
  var EVENT_KEY = '.' + DATA_KEY;
34
35
36
37
38
39
  var JQUERY_NO_CONFLICT = $.fn[NAME];
  var TRANSITION_DURATION = 150;
  var CLASS_PREFIX = 'bs-tether';

  var Default = {
    animation: true,
Mark Otto's avatar
grunt    
Mark Otto committed
40
    template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>',
41
42
43
44
45
    trigger: 'hover focus',
    title: '',
    delay: 0,
    html: false,
    selector: false,
fat's avatar
fat committed
46
    placement: 'top',
47
    offset: '0 0',
fat's avatar
fat committed
48
49
50
51
52
53
    constraints: []
  };

  var DefaultType = {
    animation: 'boolean',
    template: 'string',
XhmikosR's avatar
XhmikosR committed
54
    title: '(string|element|function)',
fat's avatar
fat committed
55
56
57
58
59
60
61
    trigger: 'string',
    delay: '(number|object)',
    html: 'boolean',
    selector: '(string|boolean)',
    placement: '(string|function)',
    offset: 'string',
    constraints: 'array'
62
63
  };

fat's avatar
fat committed
64
65
66
67
68
  var AttachmentMap = {
    TOP: 'bottom center',
    RIGHT: 'middle left',
    BOTTOM: 'top center',
    LEFT: 'middle right'
69
70
71
72
73
74
75
76
  };

  var HoverState = {
    IN: 'in',
    OUT: 'out'
  };

  var Event = {
fat's avatar
fat committed
77
78
79
80
81
82
83
84
85
86
    HIDE: 'hide' + EVENT_KEY,
    HIDDEN: 'hidden' + EVENT_KEY,
    SHOW: 'show' + EVENT_KEY,
    SHOWN: 'shown' + EVENT_KEY,
    INSERTED: 'inserted' + EVENT_KEY,
    CLICK: 'click' + EVENT_KEY,
    FOCUSIN: 'focusin' + EVENT_KEY,
    FOCUSOUT: 'focusout' + EVENT_KEY,
    MOUSEENTER: 'mouseenter' + EVENT_KEY,
    MOUSELEAVE: 'mouseleave' + EVENT_KEY
87
88
89
90
91
92
93
94
95
  };

  var ClassName = {
    FADE: 'fade',
    IN: 'in'
  };

  var Selector = {
    TOOLTIP: '.tooltip',
96
97
    TOOLTIP_INNER: '.tooltip-inner'
  };
98
99

  var TetherClass = {
fat's avatar
fat committed
100
101
102
103
104
105
106
107
108
    element: false,
    enabled: false
  };

  var Trigger = {
    HOVER: 'hover',
    FOCUS: 'focus',
    CLICK: 'click',
    MANUAL: 'manual'
109
110
111
112
113
114
115
116
  };

  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
grunt    
Mark Otto committed
117
  var Tooltip = function () {
118
119
120
121
122
123
124
125
    function Tooltip(element, config) {
      _classCallCheck(this, Tooltip);

      // private
      this._isEnabled = true;
      this._timeout = 0;
      this._hoverState = '';
      this._activeTrigger = {};
fat's avatar
fat committed
126
      this._tether = null;
127
128
129
130
131
132
133
134
135

      // protected
      this.element = element;
      this.config = this._getConfig(config);
      this.tip = null;

      this._setListeners();
    }

Jacob Thornton's avatar
Jacob Thornton committed
136
137
    // getters

Mark Otto's avatar
grunt    
Mark Otto committed
138
    // public
139

Mark Otto's avatar
grunt    
Mark Otto committed
140
141
142
    Tooltip.prototype.enable = function enable() {
      this._isEnabled = true;
    };
143

Mark Otto's avatar
grunt    
Mark Otto committed
144
145
146
    Tooltip.prototype.disable = function disable() {
      this._isEnabled = false;
    };
147

Mark Otto's avatar
grunt    
Mark Otto committed
148
149
150
    Tooltip.prototype.toggleEnabled = function toggleEnabled() {
      this._isEnabled = !this._isEnabled;
    };
Mark Otto's avatar
Mark Otto committed
151

Mark Otto's avatar
grunt    
Mark Otto committed
152
153
154
155
    Tooltip.prototype.toggle = function toggle(event) {
      if (event) {
        var dataKey = this.constructor.DATA_KEY;
        var context = $(event.currentTarget).data(dataKey);
Mark Otto's avatar
Mark Otto committed
156

Mark Otto's avatar
grunt    
Mark Otto committed
157
158
159
        if (!context) {
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
          $(event.currentTarget).data(dataKey, context);
160
        }
fat's avatar
fat committed
161

Mark Otto's avatar
grunt    
Mark Otto committed
162
        context._activeTrigger.click = !context._activeTrigger.click;
fat's avatar
fat committed
163

Mark Otto's avatar
grunt    
Mark Otto committed
164
165
166
167
        if (context._isWithActiveTrigger()) {
          context._enter(null, context);
        } else {
          context._leave(null, context);
fat's avatar
fat committed
168
        }
Mark Otto's avatar
grunt    
Mark Otto committed
169
      } else {
fat's avatar
fat committed
170

Mark Otto's avatar
grunt    
Mark Otto committed
171
172
173
174
        if ($(this.getTipElement()).hasClass(ClassName.IN)) {
          this._leave(null, this);
          return;
        }
fat's avatar
fat committed
175

Mark Otto's avatar
grunt    
Mark Otto committed
176
        this._enter(null, this);
177
      }
Mark Otto's avatar
grunt    
Mark Otto committed
178
    };
179

Mark Otto's avatar
grunt    
Mark Otto committed
180
181
    Tooltip.prototype.dispose = function dispose() {
      clearTimeout(this._timeout);
182

Mark Otto's avatar
grunt    
Mark Otto committed
183
      this.cleanupTether();
184

Mark Otto's avatar
grunt    
Mark Otto committed
185
      $.removeData(this.element, this.constructor.DATA_KEY);
186

Mark Otto's avatar
grunt    
Mark Otto committed
187
      $(this.element).off(this.constructor.EVENT_KEY);
188

Mark Otto's avatar
grunt    
Mark Otto committed
189
190
191
      if (this.tip) {
        $(this.tip).remove();
      }
192

Mark Otto's avatar
grunt    
Mark Otto committed
193
194
195
196
197
      this._isEnabled = null;
      this._timeout = null;
      this._hoverState = null;
      this._activeTrigger = null;
      this._tether = null;
198

Mark Otto's avatar
grunt    
Mark Otto committed
199
200
201
202
      this.element = null;
      this.config = null;
      this.tip = null;
    };
203

Mark Otto's avatar
grunt    
Mark Otto committed
204
205
    Tooltip.prototype.show = function show() {
      var _this = this;
206

Mark Otto's avatar
grunt    
Mark Otto committed
207
      var showEvent = $.Event(this.constructor.Event.SHOW);
208

Mark Otto's avatar
grunt    
Mark Otto committed
209
210
      if (this.isWithContent() && this._isEnabled) {
        $(this.element).trigger(showEvent);
211

Mark Otto's avatar
grunt    
Mark Otto committed
212
        var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
213

Mark Otto's avatar
grunt    
Mark Otto committed
214
215
216
        if (showEvent.isDefaultPrevented() || !isInTheDom) {
          return;
        }
217

Mark Otto's avatar
grunt    
Mark Otto committed
218
219
        var tip = this.getTipElement();
        var tipId = Util.getUID(this.constructor.NAME);
220

Mark Otto's avatar
grunt    
Mark Otto committed
221
222
        tip.setAttribute('id', tipId);
        this.element.setAttribute('aria-describedby', tipId);
223

Mark Otto's avatar
grunt    
Mark Otto committed
224
        this.setContent();
225

Mark Otto's avatar
grunt    
Mark Otto committed
226
227
228
        if (this.config.animation) {
          $(tip).addClass(ClassName.FADE);
        }
229

Mark Otto's avatar
grunt    
Mark Otto committed
230
        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
231

Mark Otto's avatar
grunt    
Mark Otto committed
232
        var attachment = this._getAttachment(placement);
233

Mark Otto's avatar
grunt    
Mark Otto committed
234
        $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
Mark Otto's avatar
Mark Otto committed
235

Mark Otto's avatar
grunt    
Mark Otto committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
        $(this.element).trigger(this.constructor.Event.INSERTED);

        this._tether = new Tether({
          attachment: attachment,
          element: tip,
          target: this.element,
          classes: TetherClass,
          classPrefix: CLASS_PREFIX,
          offset: this.config.offset,
          constraints: this.config.constraints,
          addTargetClasses: false
        });

        Util.reflow(tip);
        this._tether.position();

        $(tip).addClass(ClassName.IN);
253
254

        var complete = function complete() {
Mark Otto's avatar
grunt    
Mark Otto committed
255
256
          var prevHoverState = _this._hoverState;
          _this._hoverState = null;
257

Mark Otto's avatar
grunt    
Mark Otto committed
258
          $(_this.element).trigger(_this.constructor.Event.SHOWN);
259

Mark Otto's avatar
grunt    
Mark Otto committed
260
261
          if (prevHoverState === HoverState.OUT) {
            _this._leave(null, _this);
262
263
264
          }
        };

Mark Otto's avatar
grunt    
Mark Otto committed
265
266
        if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
          $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
267
268
269
          return;
        }

Mark Otto's avatar
grunt    
Mark Otto committed
270
271
272
        complete();
      }
    };
273

Mark Otto's avatar
grunt    
Mark Otto committed
274
275
    Tooltip.prototype.hide = function hide(callback) {
      var _this2 = this;
276

Mark Otto's avatar
grunt    
Mark Otto committed
277
278
279
280
281
      var tip = this.getTipElement();
      var hideEvent = $.Event(this.constructor.Event.HIDE);
      var complete = function complete() {
        if (_this2._hoverState !== HoverState.IN && tip.parentNode) {
          tip.parentNode.removeChild(tip);
282
283
        }

Mark Otto's avatar
grunt    
Mark Otto committed
284
285
286
        _this2.element.removeAttribute('aria-describedby');
        $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
        _this2.cleanupTether();
287

Mark Otto's avatar
grunt    
Mark Otto committed
288
289
290
291
        if (callback) {
          callback();
        }
      };
292

Mark Otto's avatar
grunt    
Mark Otto committed
293
294
295
296
      $(this.element).trigger(hideEvent);

      if (hideEvent.isDefaultPrevented()) {
        return;
297
298
      }

Mark Otto's avatar
grunt    
Mark Otto committed
299
      $(tip).removeClass(ClassName.IN);
300

Mark Otto's avatar
grunt    
Mark Otto committed
301
      if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
302

Mark Otto's avatar
grunt    
Mark Otto committed
303
304
305
        $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
      } else {
        complete();
306
      }
Mark Otto's avatar
grunt    
Mark Otto committed
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337

      this._hoverState = '';
    };

    // protected

    Tooltip.prototype.isWithContent = function isWithContent() {
      return Boolean(this.getTitle());
    };

    Tooltip.prototype.getTipElement = function getTipElement() {
      return this.tip = this.tip || $(this.config.template)[0];
    };

    Tooltip.prototype.setContent = function setContent() {
      var $tip = $(this.getTipElement());

      this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());

      $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);

      this.cleanupTether();
    };

    Tooltip.prototype.setElementContent = function setElementContent($element, content) {
      var html = this.config.html;
      if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
        // content is a DOM node or a jQuery
        if (html) {
          if (!$(content).parent().is($element)) {
            $element.empty().append(content);
XhmikosR's avatar
XhmikosR committed
338
339
          }
        } else {
Mark Otto's avatar
grunt    
Mark Otto committed
340
          $element.text($(content).text());
XhmikosR's avatar
XhmikosR committed
341
        }
Mark Otto's avatar
grunt    
Mark Otto committed
342
343
      } else {
        $element[html ? 'html' : 'text'](content);
XhmikosR's avatar
XhmikosR committed
344
      }
Mark Otto's avatar
grunt    
Mark Otto committed
345
    };
346

Mark Otto's avatar
grunt    
Mark Otto committed
347
348
    Tooltip.prototype.getTitle = function getTitle() {
      var title = this.element.getAttribute('data-original-title');
349

Mark Otto's avatar
grunt    
Mark Otto committed
350
351
      if (!title) {
        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
352
353
      }

Mark Otto's avatar
grunt    
Mark Otto committed
354
355
      return title;
    };
356

Mark Otto's avatar
grunt    
Mark Otto committed
357
358
359
    Tooltip.prototype.cleanupTether = function cleanupTether() {
      if (this._tether) {
        this._tether.destroy();
fat's avatar
fat committed
360
      }
Mark Otto's avatar
grunt    
Mark Otto committed
361
    };
362

Mark Otto's avatar
grunt    
Mark Otto committed
363
    // private
364

Mark Otto's avatar
grunt    
Mark Otto committed
365
366
367
    Tooltip.prototype._getAttachment = function _getAttachment(placement) {
      return AttachmentMap[placement.toUpperCase()];
    };
368

Mark Otto's avatar
grunt    
Mark Otto committed
369
370
    Tooltip.prototype._setListeners = function _setListeners() {
      var _this3 = this;
371

Mark Otto's avatar
grunt    
Mark Otto committed
372
373
374
375
376
377
378
379
380
381
      var triggers = this.config.trigger.split(' ');

      triggers.forEach(function (trigger) {
        if (trigger === 'click') {
          $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3));
        } else if (trigger !== Trigger.MANUAL) {
          var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
          var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;

          $(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3));
382
        }
Mark Otto's avatar
grunt    
Mark Otto committed
383
384
385
386
387
388
389
390
391
      });

      if (this.config.selector) {
        this.config = $.extend({}, this.config, {
          trigger: 'manual',
          selector: ''
        });
      } else {
        this._fixTitle();
392
      }
Mark Otto's avatar
grunt    
Mark Otto committed
393
    };
fat's avatar
fat committed
394

Mark Otto's avatar
grunt    
Mark Otto committed
395
396
397
398
399
400
401
    Tooltip.prototype._fixTitle = function _fixTitle() {
      var titleType = _typeof(this.element.getAttribute('data-original-title'));
      if (this.element.getAttribute('title') || titleType !== 'string') {
        this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
        this.element.setAttribute('title', '');
      }
    };
402

Mark Otto's avatar
grunt    
Mark Otto committed
403
404
    Tooltip.prototype._enter = function _enter(event, context) {
      var dataKey = this.constructor.DATA_KEY;
405

Mark Otto's avatar
grunt    
Mark Otto committed
406
      context = context || $(event.currentTarget).data(dataKey);
407

Mark Otto's avatar
grunt    
Mark Otto committed
408
409
410
411
      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
        $(event.currentTarget).data(dataKey, context);
      }
412

Mark Otto's avatar
grunt    
Mark Otto committed
413
414
415
      if (event) {
        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
      }
416

Mark Otto's avatar
grunt    
Mark Otto committed
417
      if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
418
        context._hoverState = HoverState.IN;
Mark Otto's avatar
grunt    
Mark Otto committed
419
420
421
422
423
424
        return;
      }

      clearTimeout(context._timeout);

      context._hoverState = HoverState.IN;
425

Mark Otto's avatar
grunt    
Mark Otto committed
426
427
428
429
430
431
432
      if (!context.config.delay || !context.config.delay.show) {
        context.show();
        return;
      }

      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.IN) {
433
434
          context.show();
        }
Mark Otto's avatar
grunt    
Mark Otto committed
435
436
      }, context.config.delay.show);
    };
437

Mark Otto's avatar
grunt    
Mark Otto committed
438
439
    Tooltip.prototype._leave = function _leave(event, context) {
      var dataKey = this.constructor.DATA_KEY;
fat's avatar
fat committed
440

Mark Otto's avatar
grunt    
Mark Otto committed
441
      context = context || $(event.currentTarget).data(dataKey);
442

Mark Otto's avatar
grunt    
Mark Otto committed
443
444
445
446
      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
        $(event.currentTarget).data(dataKey, context);
      }
447

Mark Otto's avatar
grunt    
Mark Otto committed
448
449
450
      if (event) {
        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
      }
451

Mark Otto's avatar
grunt    
Mark Otto committed
452
453
454
455
456
      if (context._isWithActiveTrigger()) {
        return;
      }

      clearTimeout(context._timeout);
457

Mark Otto's avatar
grunt    
Mark Otto committed
458
      context._hoverState = HoverState.OUT;
459

Mark Otto's avatar
grunt    
Mark Otto committed
460
461
462
463
      if (!context.config.delay || !context.config.delay.hide) {
        context.hide();
        return;
      }
464

Mark Otto's avatar
grunt    
Mark Otto committed
465
466
      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.OUT) {
467
468
          context.hide();
        }
Mark Otto's avatar
grunt    
Mark Otto committed
469
470
      }, context.config.delay.hide);
    };
471

Mark Otto's avatar
grunt    
Mark Otto committed
472
473
474
475
    Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
      for (var trigger in this._activeTrigger) {
        if (this._activeTrigger[trigger]) {
          return true;
476
477
478
        }
      }

Mark Otto's avatar
grunt    
Mark Otto committed
479
480
481
482
483
      return false;
    };

    Tooltip.prototype._getConfig = function _getConfig(config) {
      config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
fat's avatar
fat committed
484

Mark Otto's avatar
grunt    
Mark Otto committed
485
486
487
488
489
      if (config.delay && typeof config.delay === 'number') {
        config.delay = {
          show: config.delay,
          hide: config.delay
        };
490
      }
Mark Otto's avatar
grunt    
Mark Otto committed
491
492
493
494
495
496
497
498
499
500
501
502
503

      Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);

      return config;
    };

    Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
      var config = {};

      if (this.config) {
        for (var key in this.config) {
          if (this.constructor.Default[key] !== this.config[key]) {
            config[key] = this.config[key];
504
505
506
          }
        }
      }
Jacob Thornton's avatar
Jacob Thornton committed
507

Mark Otto's avatar
grunt    
Mark Otto committed
508
509
      return config;
    };
Jacob Thornton's avatar
Jacob Thornton committed
510

Mark Otto's avatar
grunt    
Mark Otto committed
511
    // static
Jacob Thornton's avatar
Jacob Thornton committed
512

Mark Otto's avatar
grunt    
Mark Otto committed
513
514
515
516
    Tooltip._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;
517

Mark Otto's avatar
grunt    
Mark Otto committed
518
519
520
        if (!data && /destroy|hide/.test(config)) {
          return;
        }
521

Mark Otto's avatar
grunt    
Mark Otto committed
522
523
524
525
526
527
528
529
        if (!data) {
          data = new Tooltip(this, _config);
          $(this).data(DATA_KEY, data);
        }

        if (typeof config === 'string') {
          if (data[config] === undefined) {
            throw new Error('No method named "' + config + '"');
Jacob Thornton's avatar
Jacob Thornton committed
530
          }
Mark Otto's avatar
grunt    
Mark Otto committed
531
532
533
534
535
536
          data[config]();
        }
      });
    };

    _createClass(Tooltip, null, [{
Jacob Thornton's avatar
Jacob Thornton committed
537
538
      key: 'VERSION',
      get: function get() {
539
540
541
542
        return VERSION;
      }
    }, {
      key: 'Default',
Jacob Thornton's avatar
Jacob Thornton committed
543
      get: function get() {
544
545
        return Default;
      }
fat's avatar
fat committed
546
547
    }, {
      key: 'NAME',
Jacob Thornton's avatar
Jacob Thornton committed
548
      get: function get() {
fat's avatar
fat committed
549
550
551
552
        return NAME;
      }
    }, {
      key: 'DATA_KEY',
Jacob Thornton's avatar
Jacob Thornton committed
553
      get: function get() {
fat's avatar
fat committed
554
555
556
557
        return DATA_KEY;
      }
    }, {
      key: 'Event',
Jacob Thornton's avatar
Jacob Thornton committed
558
      get: function get() {
fat's avatar
fat committed
559
560
        return Event;
      }
fat's avatar
fat committed
561
562
    }, {
      key: 'EVENT_KEY',
Jacob Thornton's avatar
Jacob Thornton committed
563
      get: function get() {
fat's avatar
fat committed
564
565
        return EVENT_KEY;
      }
fat's avatar
fat committed
566
567
    }, {
      key: 'DefaultType',
Jacob Thornton's avatar
Jacob Thornton committed
568
      get: function get() {
fat's avatar
fat committed
569
570
        return DefaultType;
      }
571
572
573
    }]);

    return Tooltip;
Mark Otto's avatar
grunt    
Mark Otto committed
574
575
576
577
578
579
580
  }();

  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
581
582
583
584
585
586
587
588
589

  $.fn[NAME] = Tooltip._jQueryInterface;
  $.fn[NAME].Constructor = Tooltip;
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Tooltip._jQueryInterface;
  };

  return Tooltip;
Mark Otto's avatar
grunt    
Mark Otto committed
590
}(jQuery); /* global Tether */
Jacob Thornton's avatar
Jacob Thornton committed
591
//# sourceMappingURL=tooltip.js.map