PluginProbe
Booking Calendar / 11.6
Booking Calendar v11.6
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
booking / includes / __js / client / popover / timeline_popover.js

timeline_popover.js in Booking Calendar 11.6, at includes/__js/client/popover/timeline_popover.js

51 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 // FixIn: 10.2.0.4.
3 /**
4 * Define Popovers for Timelines in WP Booking Calendar
5 *
6 * @returns {string|boolean}
7 */
8 function wpbc_define_tippy_popover(){
9 if ( 'function' !== typeof (wpbc_tippy) ){
10 console.log( 'WPBC Error. wpbc_tippy was not defined.' );
11 return false;
12 }
13 wpbc_tippy( '.popover_bottom.popover_click', {
14 content( reference ){
15 var popover_title = reference.getAttribute( 'data-original-title' );
16 var popover_content = reference.getAttribute( 'data-content' );
17 return '<div class="popover popover_tippy">'
18 + '<div class="popover-close"><a href="javascript:void(0)" onclick="javascript:this.parentElement.parentElement.parentElement.parentElement.parentElement._tippy.hide();" >&times;</a></div>'
19 + popover_content
20 + '</div>';
21 },
22 allowHTML : true,
23 trigger : 'manual',
24 interactive : true,
25 hideOnClick : false,
26 interactiveBorder: 10,
27 maxWidth : 550,
28 theme : 'wpbc-tippy-popover',
29 placement : 'bottom-start',
30 touch : ['hold', 500],
31 } );
32 jQuery( '.popover_bottom.popover_click' ).on( 'click', function (){
33 if ( this._tippy.state.isVisible ){
34 this._tippy.hide();
35 } else {
36 this._tippy.show();
37 }
38 } );
39 wpbc_define_hide_tippy_on_scroll();
40 }
41
42
43
44 function wpbc_define_hide_tippy_on_scroll(){
45 jQuery( '.flex_tl__scrolling_section2,.flex_tl__scrolling_sections' ).on( 'scroll', function ( event ){
46 if ( 'function' === typeof (wpbc_tippy) ){
47 wpbc_tippy.hideAll();
48 }
49 } );
50 }
51