PluginProbe
Booking Manager – Sync WP Booking Calendar – Import Events, Export Bookings to ICS Calendar / 2.1.22
Booking Manager – Sync WP Booking Calendar – Import Events, Export Bookings to ICS Calendar v2.1.22
2.1.22 2.1.21 2.1.20 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 trunk 1.1 2.0 2.0.1 2.0.10.2 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.17 2.0.18 2.0.2 2.0.20 2.0.21 All 56 releases
booking-manager / core / any / js / dismiss.js

dismiss.js in Booking Manager – Sync WP Booking Calendar – Import Events, Export Bookings to ICS Calendar 2.1.22, at core/any/js/dismiss.js

57 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * @version 1.0
3 * @desciption Dismiss Notices - Ajax handler
4 * @usage Admin panel
5 * @author wpdevelop
6 *
7 * @web-site https://oplugins.com/
8 * @email [email protected]
9 *
10 * @modified 2017-04-23
11 */
12
13 /** Ajax Request - Dismiss */
14 jQuery( function ( $ ) { // Shortcut to jQuery(document).ready(function(){ ... });
15
16 jQuery( '.wpbm_is_dismissible' ).on( 'click', '.wpbm_dismiss', function ( event ) { // This delegated event, can be run, when DOM element added after page loaded
17
18 var jq_el = jQuery( this ).closest( '.wpbm_is_dismissible' ); // Get dismissible HTML element
19
20 var params_obj = {};
21 params_obj.id = jq_el.attr( 'id' );
22 params_obj.nonce = jq_el.attr( 'data-nonce' );
23 params_obj.user_id = jq_el.attr( 'data-user-id' );
24
25 jQuery.post( wpbm_ajaxurl, {
26 action: 'WPBM_DISMISS',
27 user_id: params_obj.user_id ,
28 nonce: params_obj.nonce,
29 element_id: params_obj.id,
30 is_closed: 1
31 },
32 function ( response_data, textStatus, jqXHR ) { // success
33 // console.log( response_data ); console.log( textStatus); console.log( jqXHR ); // Debug
34 // jQuery( '#ajax_respond' ).html( response_data ); // For ability to show response, add such DIV element to page
35 }
36 ).fail( function ( jqXHR, textStatus, errorThrown ) { if ( window.console && window.console.log ){ console.log( 'Ajax_Error', jqXHR, textStatus, errorThrown ); } })
37 // .done( function ( data, textStatus, jqXHR ) { if ( window.console && window.console.log ){ console.log( 'second success', data, textStatus, jqXHR ); } })
38 // .always( function ( data_jqXHR, textStatus, jqXHR_errorThrown ) { if ( window.console && window.console.log ){ console.log( 'always finished', data_jqXHR, textStatus, jqXHR_errorThrown ); } })
39 ;
40
41 });
42
43 });
44
45
46 /* Hide */
47 jQuery( function ( $ ) { // Shortcut to jQuery(document).ready(function(){ ... });
48
49 jQuery( '.wpbm_is_hideable' ).on( 'click', '.wpbm_dismiss', function ( event ) { // This delegated event, can be run, when DOM element added after page loaded
50
51 var jq_el = jQuery( this ).closest( '.wpbm_is_hideable' ); // Get hideable HTML element
52
53 jq_el.hide();
54
55 });
56
57 });