Revert FormField->extraClass() inclusion of disabled/readonly

Introduced in d1ea74e40d, but too high risk in terms of causing
CSS or JS side effects when implemented on a FormField level.
This commit is contained in:
Ingo Schommer 2015-10-27 08:15:27 +13:00
parent ecacf52863
commit b5c10fd27d
3 changed files with 23 additions and 9 deletions

View File

@ -476,6 +476,17 @@ class AssetField extends FileField {
return $this->setConfig('downloadTemplateName', $downloadTemplateName); return $this->setConfig('downloadTemplateName', $downloadTemplateName);
} }
public function extraClass() {
if($this->isDisabled()) {
$this->addExtraClass('disabled');
}
if($this->isReadonly()) {
$this->addExtraClass('readonly');
}
return parent::extraClass();
}
public function Field($properties = array()) { public function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');

View File

@ -460,15 +460,7 @@ class FormField extends RequestHandler {
// //
// CSS class needs to be different from the one rendered through {@link FieldHolder()}. // CSS class needs to be different from the one rendered through {@link FieldHolder()}.
if($this->Message()) { if($this->Message()) {
$classes[] = 'holder-' . $this->MessageType(); $classes[] .= 'holder-' . $this->MessageType();
}
if($this->isDisabled()) {
$classes[] = 'disabled';
}
if($this->isReadonly()) {
$classes[] = 'readonly';
} }
return implode(' ', $classes); return implode(' ', $classes);

View File

@ -912,6 +912,17 @@ class UploadField extends FileField {
); );
} }
public function extraClass() {
if($this->isDisabled()) {
$this->addExtraClass('disabled');
}
if($this->isReadonly()) {
$this->addExtraClass('readonly');
}
return parent::extraClass();
}
public function Field($properties = array()) { public function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');