mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
ecacf52863
commit
b5c10fd27d
@ -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');
|
||||||
|
@ -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);
|
||||||
|
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user