| 1 |
/** |
| 2 |
Responsive Menu JS file. |
| 3 |
NOT Safe to Copy |
| 4 |
|
| 5 |
Do Not Copy |
| 6 |
**/ |
| 7 |
|
| 8 |
jQuery(function($) { |
| 9 |
|
| 10 |
/* --> Colour Select Options */ |
| 11 |
$.minicolors.defaults = $.extend( |
| 12 |
$.minicolors.defaults, { |
| 13 |
format: 'hex', |
| 14 |
opacity: false, |
| 15 |
theme: 'bootstrap' |
| 16 |
} |
| 17 |
); |
| 18 |
$('.mini-colours').minicolors(); |
| 19 |
/* <-- End Colour Select Options */ |
| 20 |
|
| 21 |
/* --> Hide Pro Options */ |
| 22 |
$(document).on('change', '#hide-pro-options', function() { |
| 23 |
if($(this).is(':checked')) { |
| 24 |
$('.nav > li.pro-tab, ' + |
| 25 |
'.fully-pro-container, ' + |
| 26 |
'.responsive-menu-preview, ' + |
| 27 |
'.pro-row' |
| 28 |
).hide(); |
| 29 |
} else { |
| 30 |
$('.nav > li.pro-tab, ' + |
| 31 |
'.fully-pro-container, ' + |
| 32 |
'.responsive-menu-preview, ' + |
| 33 |
'.pro-row' |
| 34 |
).show(); |
| 35 |
} |
| 36 |
}); |
| 37 |
/* <-- End Hide Pro Options */ |
| 38 |
|
| 39 |
/* --> Preview Options */ |
| 40 |
$(document).on('click', '.responsive-menu-preview', function(e) { |
| 41 |
e.preventDefault(); |
| 42 |
var form = $('#responsive-menu-form'); |
| 43 |
form.attr('action', WP_RMP.HOME_URL + '?responsive-menu-preview=true'); |
| 44 |
form.attr('target', '_blank'); |
| 45 |
form.submit(); |
| 46 |
form.attr('action', ''); |
| 47 |
form.attr('target', ''); |
| 48 |
}); |
| 49 |
/* <-- End Preview Options */ |
| 50 |
|
| 51 |
/** Move to new version */ |
| 52 |
jQuery('.rmp-upgrade-version').on( 'click', function(e) { |
| 53 |
e.preventDefault(); |
| 54 |
jQuery.ajax({ |
| 55 |
url: ajaxurl, |
| 56 |
data: { action : 'rmp_switch_version' }, |
| 57 |
type: 'POST', |
| 58 |
dataType: 'json', |
| 59 |
error: function( error ) { |
| 60 |
jQuery(this).prop('disabled', false); |
| 61 |
}, |
| 62 |
success: function( response ) { |
| 63 |
if ( response.data.redirect ) { |
| 64 |
location.href = response.data.redirect; |
| 65 |
} |
| 66 |
} |
| 67 |
}); |
| 68 |
}); |
| 69 |
|
| 70 |
/** Call ajax to hide admin notice permanent. */ |
| 71 |
$( '.rmp-version-upgrade-notice' ).on( 'click', '.notice-dismiss', function( event ) { |
| 72 |
event.preventDefault(); |
| 73 |
jQuery.ajax( { |
| 74 |
type: "POST", |
| 75 |
url: ajaxurl, |
| 76 |
data: "action=rmp_version_admin_notice_dismiss", |
| 77 |
}); |
| 78 |
}); |
| 79 |
|
| 80 |
}); |