Sha256: 156206eae6f242518ce67b9e9e2d4bc0545145a2b0eceb3250274a1e50736eb2
Contents?: true
Size: 1.61 KB
Versions: 6
Compression:
Stored size: 1.61 KB
Contents
// = require ./budget_rule_toggler.component // = require ./scope_picker_enabler.component // = require ./proposal_infinite_edit ((exports) => { const { BudgetRuleTogglerComponent } = exports.DecidimAdmin; const budgetRuleToggler = new BudgetRuleTogglerComponent({ ruleCheckboxes: $("input[id^='component_settings_vote_rule_']") }); budgetRuleToggler.run(); })(window); // Checks if the form contains fields with special CSS classes added in // Decidim::Admin::SettingsHelper and acts accordingly. $(() => { // Prevents readonly containers from being modified. const $readonlyContainer = $(".readonly_container input"); $readonlyContainer.click((event) => { event.preventDefault(); return false; }); // Target fields: // - amendments_wizard_help_text // - amendments_visibility // - amendment_creation_enabled // - amendment_reaction_enabled // - amendment_promotion_enabled // (1) Hides target fields if amendments_enabled component setting is NOT checked. // (2) Toggles visibilty of target fields when amendments_enabled component setting is clicked. const $amendmentsEnabled = $("input#component_settings_amendments_enabled"); if ($amendmentsEnabled.length > 0) { const $amendmentStepSettings = $(".amendments_wizard_help_text_container, .amendments_visibility_container, .amendment_creation_enabled_container, .amendment_reaction_enabled_container, .amendment_promotion_enabled_container"); if ($amendmentsEnabled.is(":not(:checked)")) { $amendmentStepSettings.hide(); } $amendmentsEnabled.click(() => { $amendmentStepSettings.toggle(); }); } });
Version data entries
6 entries across 6 versions & 1 rubygems