From ead010ba43b192d42ba1685a8f3edf69feca63a5 Mon Sep 17 00:00:00 2001 From: devin Date: Wed, 11 Mar 2015 21:50:39 -0700 Subject: [PATCH] Closes #5 --- assets/js/admin/admin-forms.js | 1 - assets/js/admin/admin-forms.min.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/admin/admin-forms.js b/assets/js/admin/admin-forms.js index 6241c29d94..5a6986e0f9 100644 --- a/assets/js/admin/admin-forms.js +++ b/assets/js/admin/admin-forms.js @@ -225,7 +225,6 @@ jQuery.noConflict(); handle_default_radio(); toggle_conditional_form_fields(); handle_repeatable_row_ID(); - handle_status_switch(); misc_cleanup(); } ); diff --git a/assets/js/admin/admin-forms.min.js b/assets/js/admin/admin-forms.min.js index 569566e0ba..da62c8e16e 100644 --- a/assets/js/admin/admin-forms.min.js +++ b/assets/js/admin/admin-forms.min.js @@ -1 +1 @@ -jQuery.noConflict(),function(e){function i(){e(".cmb2-text-money").each(function(i,n){var t=parseInt(e(n).val());t||e(n).removeAttr("value")})}var n=function(){"use strict";var i=e("input.donation-level-radio"),n=e("#_give_donation_levels_repeat > .cmb-repeatable-grouping"),t=n.length;e("body").on("change","input.donation-level-radio",function(){e("input.donation-level-radio").not(this).prop("checked",!1)}),1===t&&i.prop("checked",!0),e("body").on("cmb2_remove_row",function(){var i=e("#_give_donation_levels_repeat > .cmb-repeatable-grouping");e("input.donation-level-radio").is(":checked")===!1&&i.first().find("input.donation-level-radio").prop("checked",!0)})},t=function(){var i=e(".cmb2-id--give-price-option input:radio");i.on("change",function(){var i=e(".cmb2-id--give-price-option input:radio:checked").val();"set"===i?(e(".cmb2-id--give-set-price, .cmb2-id--give-recurring").show(),"yes"==e("#_give_recurring").val()&&e(".cmb2-id--give-period, .cmb2-id--give-times").show(),e(".cmb2-id--give-levels-header, .cmb2-id--give-levels-header + .cmb-repeat-group-wrap, .cmb2-id--give-display-style").hide()):(e(".cmb2-id--give-set-price, .cmb2-id--give-recurring, .cmb2-id--give-period, .cmb2-id--give-times").hide(),e(".cmb2-id--give-levels-header, .cmb2-id--give-levels-header + .cmb-repeat-group-wrap, .cmb2-id--give-display-style").show())}).change();var n=e("#_give_content_option");n.on("change",function(){"none"!==n.val()?e(".cmb2-id--give-form-content").show():e(".cmb2-id--give-form-content").hide()}).change();var t=e("#_give_terms_option");t.on("change",function(){"none"!==t.val()?(e(".cmb2-id--give-agree-label").show(),e(".cmb2-id--give-agree-text").show()):(e(".cmb2-id--give-agree-label").hide(),e(".cmb2-id--give-agree-text").hide())}).change();var o=e("#_give_payment_display");o.on("change",function(){"onpage"===o.val()?e(".cmb2-id--give-reveal-label").hide():e(".cmb2-id--give-reveal-label").show()}).change()},o=function(){function i(i){var t=n();e(i).find("input.give-level-id-input").val(t),e(i).find(".give-level-id").text(t)}function n(){var i=0,n=0,t=0;return e("#_give_donation_levels_repeat > .cmb-repeatable-grouping").each(function(){t=e(this).find("input.give-level-id-input").val(),t>n&&(n=t),i++}),"undefined"!=typeof n&&n>=i?parseInt(n)+1:i}if(""===e(".give-level-id").text()){var t=e(".cmb-repeatable-grouping");t.each(function(i,n){var t=e(n).data("iterator")+1;e(n).find(".give-level-id").text(t),e(n).find(".give-level-id-input").val(t)})}e("body").on("cmb2_add_row",function(e,n){i(n)}),e("body").on("cmb2_shift_rows_complete",function(){var i=e(".cmb-repeatable-grouping");i.each(function(i,n){var t=e(n).find("input.give-level-id-input").val();e(n).find(".give-level-id").text(t)})})};e(function(){n(),t(),o(),handle_status_switch(),i()})}(jQuery); \ No newline at end of file +jQuery.noConflict(),function(e){function i(){e(".cmb2-text-money").each(function(i,n){var t=parseInt(e(n).val());t||e(n).removeAttr("value")})}var n=function(){"use strict";var i=e("input.donation-level-radio"),n=e("#_give_donation_levels_repeat > .cmb-repeatable-grouping"),t=n.length;e("body").on("change","input.donation-level-radio",function(){e("input.donation-level-radio").not(this).prop("checked",!1)}),1===t&&i.prop("checked",!0),e("body").on("cmb2_remove_row",function(){var i=e("#_give_donation_levels_repeat > .cmb-repeatable-grouping");e("input.donation-level-radio").is(":checked")===!1&&i.first().find("input.donation-level-radio").prop("checked",!0)})},t=function(){var i=e(".cmb2-id--give-price-option input:radio");i.on("change",function(){var i=e(".cmb2-id--give-price-option input:radio:checked").val();"set"===i?(e(".cmb2-id--give-set-price, .cmb2-id--give-recurring").show(),"yes"==e("#_give_recurring").val()&&e(".cmb2-id--give-period, .cmb2-id--give-times").show(),e(".cmb2-id--give-levels-header, .cmb2-id--give-levels-header + .cmb-repeat-group-wrap, .cmb2-id--give-display-style").hide()):(e(".cmb2-id--give-set-price, .cmb2-id--give-recurring, .cmb2-id--give-period, .cmb2-id--give-times").hide(),e(".cmb2-id--give-levels-header, .cmb2-id--give-levels-header + .cmb-repeat-group-wrap, .cmb2-id--give-display-style").show())}).change();var n=e("#_give_content_option");n.on("change",function(){"none"!==n.val()?e(".cmb2-id--give-form-content").show():e(".cmb2-id--give-form-content").hide()}).change();var t=e("#_give_terms_option");t.on("change",function(){"none"!==t.val()?(e(".cmb2-id--give-agree-label").show(),e(".cmb2-id--give-agree-text").show()):(e(".cmb2-id--give-agree-label").hide(),e(".cmb2-id--give-agree-text").hide())}).change();var o=e("#_give_payment_display");o.on("change",function(){"onpage"===o.val()?e(".cmb2-id--give-reveal-label").hide():e(".cmb2-id--give-reveal-label").show()}).change()},o=function(){function i(i){var t=n();e(i).find("input.give-level-id-input").val(t),e(i).find(".give-level-id").text(t)}function n(){var i=0,n=0,t=0;return e("#_give_donation_levels_repeat > .cmb-repeatable-grouping").each(function(){t=e(this).find("input.give-level-id-input").val(),t>n&&(n=t),i++}),"undefined"!=typeof n&&n>=i?parseInt(n)+1:i}if(""===e(".give-level-id").text()){var t=e(".cmb-repeatable-grouping");t.each(function(i,n){var t=e(n).data("iterator")+1;e(n).find(".give-level-id").text(t),e(n).find(".give-level-id-input").val(t)})}e("body").on("cmb2_add_row",function(e,n){i(n)}),e("body").on("cmb2_shift_rows_complete",function(){var i=e(".cmb-repeatable-grouping");i.each(function(i,n){var t=e(n).find("input.give-level-id-input").val();e(n).find(".give-level-id").text(t)})})};e(function(){n(),t(),o(),i()})}(jQuery); \ No newline at end of file