mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-59775 forms: add option to display any form vertical
This commit is contained in:
parent
032674eebc
commit
3dee4faec4
4 changed files with 81 additions and 6 deletions
|
@ -1411,6 +1411,16 @@ abstract class moodleform {
|
|||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set display mode for the form when labels take full width of the form and above the elements even on big screens
|
||||
*
|
||||
* Useful for forms displayed inside modals or in narrow containers
|
||||
*/
|
||||
public function set_display_vertical() {
|
||||
$oldclass = $this->_form->getAttribute('class');
|
||||
$this->_form->updateAttributes(array('class' => $oldclass . ' full-width-labels'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue