Recompiled JS and updated for new script name.
This commit is contained in:
1 parent
b5161c2955
commit
234ed808aa
2 files changed
+21
-12
No files matched your search
+19
-10
@@ -8,8 +8,6 @@
|
|||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
// modified to use lapstooltip as plugin name
|
|
||||||
|
|
||||||
+function ($) {
|
+function ($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@@ -24,7 +22,7 @@
|
|||||||
this.hoverState =
|
this.hoverState =
|
||||||
this.$element = null
|
this.$element = null
|
||||||
|
|
||||||
this.init('lapstooltip', element, options)
|
this.init('tooltip', element, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.VERSION = '3.2.0'
|
Tooltip.VERSION = '3.2.0'
|
||||||
@@ -433,27 +431,38 @@
|
|||||||
function Plugin(option) {
|
function Plugin(option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
var data = $this.data('bs.lapstooltip')
|
var data = $this.data('bs.tooltip')
|
||||||
var options = typeof option == 'object' && option
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
if (!data && option == 'destroy') return
|
if (!data && option == 'destroy') return
|
||||||
if (!data) $this.data('bs.lapstooltip', (data = new Tooltip(this, options)))
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||||
if (typeof option == 'string') data[option]()
|
if (typeof option == 'string') data[option]()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var old = $.fn.lapstooltip
|
var old = $.fn.tooltip
|
||||||
|
|
||||||
$.fn.lapstooltip = Plugin
|
$.fn.tooltip = Plugin
|
||||||
$.fn.lapstooltip.Constructor = Tooltip
|
$.fn.tooltip.Constructor = Tooltip
|
||||||
|
|
||||||
|
|
||||||
// TOOLTIP NO CONFLICT
|
// TOOLTIP NO CONFLICT
|
||||||
// ===================
|
// ===================
|
||||||
|
|
||||||
$.fn.lapstooltip.noConflict = function () {
|
$.fn.tooltip.noConflict = function () {
|
||||||
$.fn.lapstooltip = old
|
$.fn.tooltip = old
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
}(jQuery);
|
}(jQuery);
|
||||||
|
|
||||||
|
jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict();
|
||||||
|
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
jQuery(".laps-timeline .event").lapstooltip({
|
||||||
|
container: '#wpadminbar',
|
||||||
|
placement: 'bottom',
|
||||||
|
html : true,
|
||||||
|
animation: false
|
||||||
|
});
|
||||||
|
});
|
||||||
+2
-2
@@ -184,11 +184,11 @@ class Laps {
|
|||||||
|
|
||||||
static function enqueue_scripts() {
|
static function enqueue_scripts() {
|
||||||
|
|
||||||
wp_register_script( 'laps-tooltip', plugins_url( 'js/tooltip.js', __DIR__ ), array( 'jquery' ), '3.0.2', true );
|
wp_register_script( 'laps', plugins_url( 'js/laps.js', __DIR__ ), array( 'jquery' ), '3.2.0', true );
|
||||||
wp_register_style( 'laps', plugins_url( 'css/laps.css', __DIR__ ) );
|
wp_register_style( 'laps', plugins_url( 'css/laps.css', __DIR__ ) );
|
||||||
|
|
||||||
if ( is_admin_bar_showing() ) {
|
if ( is_admin_bar_showing() ) {
|
||||||
wp_enqueue_script( 'laps-tooltip' );
|
wp_enqueue_script( 'laps' );
|
||||||
wp_enqueue_style( 'laps' );
|
wp_enqueue_style( 'laps' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user