Fix admin ident styles

This commit is contained in:
Pedro Silva 2024-02-16 15:04:36 +00:00
parent 9fd69e7f55
commit 9d2525ffcb
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
9 changed files with 81 additions and 10 deletions

View file

@ -0,0 +1,35 @@
import BaseAction from "./BaseAction";
class VisibilityAction extends BaseAction {
run(status) {
if (status) {
if (this.config.action === 'visible') {
jQuery(this.config.selector).removeClass('ppcp-field-hidden');
}
if (this.config.action === 'enable') {
jQuery(this.config.selector).removeClass('ppcp-field-disabled')
.off('mouseup')
.find('> *')
.css('pointer-events', '');
}
} else {
if (this.config.action === 'visible') {
jQuery(this.config.selector).addClass('ppcp-field-hidden');
}
if (this.config.action === 'enable') {
jQuery(this.config.selector).addClass('ppcp-field-disabled')
.on('mouseup', function(event) {
event.stopImmediatePropagation();
})
.find('> *')
.css('pointer-events', 'none');
}
}
}
}
export default VisibilityAction;