mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 01:03:28 +09:00
Hide unnecessary fields in extravar config screen #2486
This commit is contained in:
parent
65918f67ea
commit
7d6565766a
2 changed files with 29 additions and 3 deletions
25
modules/document/tpl/js/document_extra_keys.js
Normal file
25
modules/document/tpl/js/document_extra_keys.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(function($) {
|
||||
$(function() {
|
||||
$('select#type').on('change', function() {
|
||||
const selected_type = $(this).val();
|
||||
$(this).parents('form').find('.x_control-group').each(function() {
|
||||
const visible_types = $(this).data('visibleTypes');
|
||||
if (visible_types) {
|
||||
if (visible_types.split(',').indexOf(selected_type) >= 0) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
const invisible_types = $(this).data('invisibleTypes');
|
||||
if (invisible_types) {
|
||||
if (invisible_types.split(',').indexOf(selected_type) >= 0) {
|
||||
$(this).hide();
|
||||
} else {
|
||||
$(this).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}).triggerHandler('change');
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue