mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixing deselect failing to change field title
This commit is contained in:
parent
e0d7400aea
commit
e443a10a5e
@ -103,6 +103,7 @@ class TreeMultiselectField extends TreeDropdownField {
|
||||
$titleArray = array();
|
||||
$idArray = array();
|
||||
$items = $this->getItems();
|
||||
$emptyTitle = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
||||
|
||||
if($items && count($items)) {
|
||||
foreach($items as $item) {
|
||||
@ -115,7 +116,7 @@ class TreeMultiselectField extends TreeDropdownField {
|
||||
$title = implode(", ", $titleArray);
|
||||
$value = implode(",", $idArray);
|
||||
} else {
|
||||
$title = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
||||
$title = $emptyTitle;
|
||||
}
|
||||
|
||||
$dataUrlTree = '';
|
||||
@ -129,6 +130,7 @@ class TreeMultiselectField extends TreeDropdownField {
|
||||
$properties,
|
||||
array(
|
||||
'Title' => $title,
|
||||
'EmptyTitle' => $emptyTitle,
|
||||
'Link' => $dataUrlTree,
|
||||
'Value' => $value
|
||||
)
|
||||
|
@ -138,7 +138,7 @@
|
||||
this[this.getPanel().is(':visible') ? 'closePanel' : 'openPanel']();
|
||||
},
|
||||
setTitle: function(title) {
|
||||
title = title || this.data('title') || strings.fieldTitle;
|
||||
title = title || this.data('empty-title') || strings.fieldTitle;
|
||||
|
||||
this.find('.treedropdownfield-title').html(title);
|
||||
this.data('title', title); // separate view from storage (important for search cancellation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user