| 1 |
/* global propertyhive_admin */ |
| 2 |
|
| 3 |
/** |
| 4 |
* Property Hive Admin JS |
| 5 |
*/ |
| 6 |
jQuery( function ( $ ) { |
| 7 |
|
| 8 |
$( document.body ) |
| 9 |
|
| 10 |
.on( 'init_tooltips', function() { |
| 11 |
activateTipTip(); |
| 12 |
}); |
| 13 |
|
| 14 |
// Tooltips |
| 15 |
$( document.body ).trigger( 'init_tooltips' ); |
| 16 |
|
| 17 |
$( '#ph_dismiss_notice_leave_review' ).click(function(e) |
| 18 |
{ |
| 19 |
e.preventDefault(); |
| 20 |
|
| 21 |
var data = { |
| 22 |
'action': 'propertyhive_dismiss_notice_leave_review' |
| 23 |
}; |
| 24 |
|
| 25 |
$.post( ajaxurl, data, function(response) { |
| 26 |
$( '#ph_notice_leave_review' ).fadeOut(); |
| 27 |
}); |
| 28 |
}); |
| 29 |
|
| 30 |
$( '#ph_dismiss_notice_missing_search_results' ).click(function(e) |
| 31 |
{ |
| 32 |
e.preventDefault(); |
| 33 |
|
| 34 |
var data = { |
| 35 |
'action': 'propertyhive_dismiss_notice_missing_search_results' |
| 36 |
}; |
| 37 |
|
| 38 |
$.post( ajaxurl, data, function(response) { |
| 39 |
$( '#ph_notice_missing_search_results' ).fadeOut(); |
| 40 |
}); |
| 41 |
}); |
| 42 |
|
| 43 |
$( '#ph_dismiss_notice_missing_google_maps_api_key' ).click(function(e) |
| 44 |
{ |
| 45 |
e.preventDefault(); |
| 46 |
|
| 47 |
var data = { |
| 48 |
'action': 'propertyhive_dismiss_notice_missing_google_maps_api_key' |
| 49 |
}; |
| 50 |
|
| 51 |
$.post( ajaxurl, data, function(response) { |
| 52 |
$( '#ph_notice_missing_google_maps_api_key' ).fadeOut(); |
| 53 |
}); |
| 54 |
}); |
| 55 |
|
| 56 |
$( '#ph_dismiss_notice_invalid_expired_license_key' ).click(function(e) |
| 57 |
{ |
| 58 |
e.preventDefault(); |
| 59 |
|
| 60 |
var data = { |
| 61 |
'action': 'propertyhive_dismiss_notice_invalid_expired_license_key' |
| 62 |
}; |
| 63 |
|
| 64 |
$.post( ajaxurl, data, function(response) { |
| 65 |
$( '#ph_notice_invalid_expired_license_key' ).fadeOut(); |
| 66 |
}); |
| 67 |
}); |
| 68 |
}); |
| 69 |
|
| 70 |
function activateTipTip() { |
| 71 |
var tiptip_args = { |
| 72 |
'attribute': 'data-tip', |
| 73 |
'fadeIn': 50, |
| 74 |
'fadeOut': 50, |
| 75 |
'delay': 200 |
| 76 |
}; |
| 77 |
|
| 78 |
jQuery( '.help_tip' ).tipTip( tiptip_args ); |
| 79 |
} |