From 4cdf206de9abdaac05b96b193262ce63b6f8b4e4 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Thu, 23 Oct 2014 22:09:48 +0300 Subject: [PATCH] Moved JS from inline PHP to own source file. --- js/source.js | 11 +++++++++++ src/class-laps.php | 17 ----------------- 2 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 js/source.js diff --git a/js/source.js b/js/source.js new file mode 100644 index 0000000..207ff41 --- /dev/null +++ b/js/source.js @@ -0,0 +1,11 @@ + +jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict(); + +jQuery(document).ready(function () { + jQuery(".laps-timeline .event").lapstooltip({ + container: '#wpadminbar', + placement: 'bottom', + html : true, + animation: false + }); +}); diff --git a/src/class-laps.php b/src/class-laps.php index 830daac..31bb5c0 100644 --- a/src/class-laps.php +++ b/src/class-laps.php @@ -180,8 +180,6 @@ class Laps { add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 100 ); - add_action( 'wp_print_footer_scripts', array( __CLASS__, 'print_footer_scripts' ), 11 ); - add_action( 'admin_print_footer_scripts', array( __CLASS__, 'print_footer_scripts' ), 11 ); } static function enqueue_scripts() { @@ -195,21 +193,6 @@ class Laps { } } - static function print_footer_scripts() { - - if ( wp_script_is( 'laps-tooltip', 'done' ) ) { - ?> -