Improve geo_node_form.js

parent 1d99729b
export default class GeoNodeForm { export default class GeoNodeForm {
constructor(container) { constructor(container) {
this.$container = $(container); this.$container = container;
this.$namespaces = this.$container.find(".js-namespaces"); this.$namespaces = this.$container.find(".js-namespaces");
this.$namespacesSelect = this.$namespaces.find('.select2'); this.$namespacesSelect = this.$namespaces.find('.select2');
this.$primaryCheckbox = this.$container.find("input[type='checkbox']"); this.$primaryCheckbox = this.$container.find("input[type='checkbox']");
...@@ -9,11 +9,6 @@ export default class GeoNodeForm { ...@@ -9,11 +9,6 @@ export default class GeoNodeForm {
onPrimaryCheckboxChange(event) { onPrimaryCheckboxChange(event) {
this.$namespacesSelect.select2('data', null); this.$namespacesSelect.select2('data', null);
this.$namespaces.toggleClass('hidden', this.$primaryCheckbox.is(':checked'))
if (this.$primaryCheckbox.is(':checked')) {
this.$namespaces.addClass('hidden');
} else {
this.$namespaces.removeClass('hidden');
}
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment