mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-08 18:44:03 +00:00
2.0.17
This commit is contained in:
57
assets/js/admin/admin-pointers.js
Normal file
57
assets/js/admin/admin-pointers.js
Normal file
@@ -0,0 +1,57 @@
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
if(arePointersEnabled()){
|
||||
setTimeout(showSubscriptionPointers, 800); // give TinyMCE a chance to finish loading
|
||||
}
|
||||
|
||||
$('select#product-type').change(function(){
|
||||
if(arePointersEnabled()){
|
||||
$('#product-type').pointer('close');
|
||||
}
|
||||
});
|
||||
|
||||
$('#_subscription_price, #_subscription_period, #_subscription_length').change(function(){
|
||||
if(arePointersEnabled()){
|
||||
$('.options_group.subscription_pricing').pointer('close');
|
||||
$('#product-type').pointer('close');
|
||||
}
|
||||
});
|
||||
|
||||
function arePointersEnabled(){
|
||||
if($.getParameterByName('subscription_pointers')=='true'){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function showSubscriptionPointers(){
|
||||
$('#product-type').pointer({
|
||||
content: WCSPointers.typePointerContent,
|
||||
position: {
|
||||
edge: 'left',
|
||||
align: 'center'
|
||||
},
|
||||
close: function() {
|
||||
if ($('select#product-type').val()==WCSubscriptions.productType){
|
||||
$('.options_group.subscription_pricing:not(".subscription_sync")').pointer({
|
||||
content: WCSPointers.pricePointerContent,
|
||||
position: 'bottom',
|
||||
close: function() {
|
||||
dismissSubscriptionPointer();
|
||||
}
|
||||
}).pointer('open');
|
||||
}
|
||||
dismissSubscriptionPointer();
|
||||
}
|
||||
}).pointer('open');
|
||||
}
|
||||
|
||||
function dismissSubscriptionPointer(){
|
||||
$.post( ajaxurl, {
|
||||
pointer: 'wcs_pointer',
|
||||
action: 'dismiss-wp-pointer'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
Reference in New Issue
Block a user