wp/wp-content/plugins/portfolio/bws_menu/js/bws_tooltip.js
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 16 a86126ab1dd4
--- a/wp/wp-content/plugins/portfolio/bws_menu/js/bws_tooltip.js	Tue Jun 09 11:14:17 2015 +0000
+++ b/wp/wp-content/plugins/portfolio/bws_menu/js/bws_tooltip.js	Mon Oct 14 17:39:30 2019 +0200
@@ -7,11 +7,11 @@
 		jQuery.bwsTooltip = function( pointer_options ) {
 			var pointer_buttons = pointer_options['buttons'];
 			/* extend pointer options - add close button */
-			pointer_options = $.extend(pointer_options, {
+			pointer_options = $.extend( pointer_options, {
 				buttons: function(event, t) {
 					var button;
 					/* check and add dismiss-type buttons */
-					for( var but in pointer_buttons ) {
+					for ( var but in pointer_buttons ) {
 						if ( typeof pointer_buttons[ but ]['type'] != 'undefined' && pointer_buttons[ but ]['type'] == 'dismiss' && typeof pointer_buttons[ but ]['text'] != 'undefined' && pointer_buttons[ but ]['text'] != '' ) {
 							button += '<a style="margin:0px 5px 2px;" class="button-secondary">' + pointer_buttons[ but ]['text'] + '</a>';
 						}
@@ -34,11 +34,10 @@
 			});
 			/* function to display pointer */
 			function displayPointer( cssSelector ) {
-				cssSelector.pointer(pointer_options).pointer({
+				cssSelector.pointer( pointer_options ).pointer({
 					pointerClass: 'wp-pointer ' + pointer_options["tooltip_id"],
 					content: pointer_options['content'],
-					position: 
-					{
+					position: {
 						edge: pointer_options['position']['edge'],
 						align: pointer_options['position']['align'],
 					},
@@ -64,10 +63,19 @@
 					$( "." + pointer_options["tooltip_id"] ).css({ "z-index": pointer_options['position']['zindex'] });
 				}
 			}
+
 			/* display pointer for the first time */
 			if ( pointer_options['actions']['onload'] ) {
-				displayPointer( $( pointer_options['css_selector'] ) );
+				if ( pointer_options['set_timeout'] > 0 ) {
+					var settime = parseInt( pointer_options['set_timeout'] );					
+					setTimeout( function() {
+						displayPointer( $( pointer_options['css_selector'] ) );
+					}, settime );	
+				} else {
+					displayPointer( $( pointer_options['css_selector'] ) );
+				}
 			}
+						
 			/* display pointer when clicked on selector */
 			if ( pointer_options['actions']['click'] ) {
 				$( pointer_options['css_selector'] ).click( function () {