2 lines
725 B
JavaScript
2 lines
725 B
JavaScript
jQuery(function(e){const i={init(){const i=this;i.new_version=void 0,e("#wcbt-modal-version-switch-confirm").on("click",this.showConfirmVersionSwitchModal),e("input[type=radio][name=wcbt_switch_to_version]").change(function(){e(this).is(":checked")&&(i.new_version=e(this).val())}).trigger("change")},showConfirmVersionSwitchModal(i){i.preventDefault();i=this;i.new_version?(e(this).WCBackboneModal({template:"wcbt-version-switch-confirm",variable:{new_version:i.new_version}}),e("#wcbt-submit-version-switch").on("click",i.submitSwitchVersionForm)):alert(wc_beta_tester_version_picker_params.i18n_pick_version)},submitSwitchVersionForm(i){i.preventDefault(),e("form[name=wcbt-select-version]").get(0).submit()}};i.init()});
|