BUGFIX Using separate template for readonly version of Textarea (mainly to avoid SSViewer bugs, but also for more granular customisation)
This commit is contained in:
parent
a6148c33da
commit
475f3764c3
|
@ -62,6 +62,10 @@ class TextareaField extends FormField {
|
|||
return parent::Field($properties);
|
||||
}
|
||||
|
||||
function getTemplate() {
|
||||
return ($this->isReadonly()) ? "{$this->template}_Readonly" : $this->template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a readonly transformation on this field. You should still be able
|
||||
* to copy from this field, and it should still send when you submit
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
<% if isReadonly %>
|
||||
<span id="$ID" class="readonly$extraClass" name="$Name"><% if Value %>$Value<% else %><em>(<% _t('NONE', 'none') %>)</em><% end_if %></span>
|
||||
<% else %>
|
||||
<textarea id="$ID" class="textarea$extraClass" name="$Name" rows="$Rows" cols="$Cols"<% if isDisabled %> disabled<% end_if %>>$Value</textarea>
|
||||
<% end_if %>
|
||||
<textarea id="$ID" class="textarea$extraClass" name="$Name" rows="$Rows" cols="$Cols"<% if isDisabled %> disabled<% end_if %>>$Value</textarea>
|
|
@ -0,0 +1 @@
|
|||
<span id="$ID" class="readonly$extraClass" name="$Name"><% if Value %>$Value<% else %><em>(<% _t('NONE', 'none') %>)</em><% end_if %></span>
|
Loading…
Reference in New Issue