2019-03-13 19:55:11 +00:00
|
|
|
/**
|
|
|
|
* Handles version information modal.
|
|
|
|
*
|
|
|
|
* @package WooCommerceBetaTester\JS
|
|
|
|
*/
|
|
|
|
|
2018-06-06 08:02:45 +00:00
|
|
|
jQuery(function( $ ) {
|
|
|
|
|
|
|
|
/**
|
2018-06-06 12:28:24 +00:00
|
|
|
* Version information
|
2018-06-06 08:02:45 +00:00
|
|
|
*/
|
|
|
|
var wc_beta_tester_version_information = {
|
|
|
|
|
|
|
|
/**
|
2018-06-06 12:28:24 +00:00
|
|
|
* Initialize Version Information click
|
2018-06-06 08:02:45 +00:00
|
|
|
*/
|
|
|
|
init: function() {
|
|
|
|
$( '#wp-admin-bar-show-version-info' )
|
|
|
|
.on( 'click', this.showModal );
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2018-06-06 12:28:24 +00:00
|
|
|
* Handler for showing/hiding version information modal
|
2018-06-06 08:02:45 +00:00
|
|
|
*/
|
|
|
|
showModal: function( event ) {
|
|
|
|
event.preventDefault();
|
|
|
|
|
2019-03-14 15:26:54 +00:00
|
|
|
// Prevent multiple modals.
|
|
|
|
if ( 0 < $( '.wc-backbone-modal-beta-tester-version-info' ).length ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-06 08:02:45 +00:00
|
|
|
$( this ).WCBackboneModal({
|
|
|
|
template: 'wc-beta-tester-version-info',
|
|
|
|
variable: {
|
|
|
|
version: wc_beta_tester_version_info_params.version,
|
|
|
|
description: wc_beta_tester_version_info_params.description,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
wc_beta_tester_version_information.init();
|
|
|
|
});
|