Commit ce1d1a90 authored by Sam152's avatar Sam152 Committed by frjo

Issue #2642380 by Sam152: Use states API for the admin form instead of custom JavaScript toggles

parent c84536e6
......@@ -30,14 +30,6 @@ init:
- core/jquery
- core/drupal
admin_settings:
version: VERSION
js:
js/colorbox_admin_settings.js: { preprocess: false }
dependencies:
- core/jquery
- core/drupal
plain:
version: VERSION
js:
......
(function ($) {
Drupal.behaviors.initColorboxAdminSettings = {
attach: function (context, settings) {
$('div.colorbox-custom-settings-activate input.form-radio', context).click(function () {
if (this.value == 1) {
$('div.colorbox-custom-settings', context).show();
}
else {
$('div.colorbox-custom-settings', context).hide();
}
});
$('div.colorbox-slideshow-settings-activate input.form-radio', context).click(function () {
if (this.value == 1) {
$('div.colorbox-slideshow-settings', context).show();
}
else {
$('div.colorbox-slideshow-settings', context).hide();
}
});
$('div.colorbox-title-trim-settings-activate input.form-radio', context).click(function () {
if (this.value == 1) {
$('div.colorbox-title-trim-settings', context).show();
}
else {
$('div.colorbox-title-trim-settings', context).hide();
}
});
}
};
})(jQuery);
This diff is collapsed.
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