mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 05:44:36 +02:00
library/form: Append class 'autosubmit' in case the element to autosubmit has the class attribute set
Before, the class attribute would've been overwritten. refs #5525
This commit is contained in:
parent
fb5685bac3
commit
f3e74f0f24
@ -370,7 +370,15 @@ class Form extends Zend_Form
|
||||
if ($el->getAttrib('autosubmit')) {
|
||||
// Need to add this decorator first or it interferes with the other's two HTML otherwise
|
||||
$el->addDecorator(new NoScriptApply()); // Non-JS environments
|
||||
$el->setAttrib('class', 'autosubmit'); // JS environments
|
||||
$class = $el->getAttrib('class');
|
||||
if (is_array($class)) {
|
||||
$class[] = 'autosubmit';
|
||||
} elseif ($class === null) {
|
||||
$class = 'autosubmit';
|
||||
} else {
|
||||
$class .= ' autosubmit';
|
||||
}
|
||||
$el->setAttrib('class', $class); // JS environments
|
||||
unset($el->autosubmit);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user