tooltip.js 32.3 KB
Newer Older
XhmikosR's avatar
Dist    
XhmikosR committed
1001
1002
1003
1004
      this.config.animation = false;
      this.hide();
      this.show();
      this.config.animation = initConfigAnimation;
Mark Otto's avatar
Mark Otto committed
1005
1006
    } // Static
    ;
Mark Otto's avatar
dist    
Mark Otto committed
1007

XhmikosR's avatar
XhmikosR committed
1008
    Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
1009
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1010
        var data = Data.getData(this, DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
1011

XhmikosR's avatar
Dist    
XhmikosR committed
1012
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist    
Mark Otto committed
1013

XhmikosR's avatar
Dist    
XhmikosR committed
1014
1015
1016
        if (!data && /dispose|hide/.test(config)) {
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
1017

XhmikosR's avatar
Dist    
XhmikosR committed
1018
1019
1020
        if (!data) {
          data = new Tooltip(this, _config);
        }
Mark Otto's avatar
grunt    
Mark Otto committed
1021

XhmikosR's avatar
Dist    
XhmikosR committed
1022
1023
1024
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist    
Mark Otto committed
1025
1026
          }

XhmikosR's avatar
Dist    
XhmikosR committed
1027
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
1028
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1029
1030
      });
    };
Mark Otto's avatar
grunt    
Mark Otto committed
1031

XhmikosR's avatar
XhmikosR committed
1032
    Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
1033
1034
1035
      return Data.getData(element, DATA_KEY);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
    _createClass(Tooltip, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default;
      }
    }, {
      key: "NAME",
      get: function get() {
        return NAME;
      }
    }, {
      key: "DATA_KEY",
      get: function get() {
        return DATA_KEY;
      }
    }, {
      key: "Event",
      get: function get() {
XhmikosR's avatar
XhmikosR committed
1059
        return Event;
XhmikosR's avatar
Dist    
XhmikosR committed
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
      }
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType;
      }
    }]);
1072

XhmikosR's avatar
Dist    
XhmikosR committed
1073
1074
    return Tooltip;
  }();
XhmikosR's avatar
XhmikosR committed
1075
1076

  var $ = getjQuery();
XhmikosR's avatar
Dist    
XhmikosR committed
1077
1078
1079
1080
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
1081
   * add .tooltip to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
1082
   */
1083

1084
1085
  /* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1086
1087
1088
1089
  if ($) {
    var JQUERY_NO_CONFLICT = $.fn[NAME];
    $.fn[NAME] = Tooltip.jQueryInterface;
    $.fn[NAME].Constructor = Tooltip;
Mark Otto's avatar
dist    
Mark Otto committed
1090

XhmikosR's avatar
XhmikosR committed
1091
1092
1093
    $.fn[NAME].noConflict = function () {
      $.fn[NAME] = JQUERY_NO_CONFLICT;
      return Tooltip.jQueryInterface;
XhmikosR's avatar
XhmikosR committed
1094
1095
    };
  }
1096
1097

  return Tooltip;
Mark Otto's avatar
dist    
Mark Otto committed
1098

Mark Otto's avatar
Mark Otto committed
1099
}));
Mark Otto's avatar
dist    
Mark Otto committed
1100
//# sourceMappingURL=tooltip.js.map
For faster browsing, not all history is shown. View entire blame