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();
|
$titleArray = array();
|
||||||
$idArray = array();
|
$idArray = array();
|
||||||
$items = $this->getItems();
|
$items = $this->getItems();
|
||||||
|
$emptyTitle = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
||||||
|
|
||||||
if($items && count($items)) {
|
if($items && count($items)) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
@ -115,7 +116,7 @@ class TreeMultiselectField extends TreeDropdownField {
|
|||||||
$title = implode(", ", $titleArray);
|
$title = implode(", ", $titleArray);
|
||||||
$value = implode(",", $idArray);
|
$value = implode(",", $idArray);
|
||||||
} else {
|
} else {
|
||||||
$title = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');
|
$title = $emptyTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dataUrlTree = '';
|
$dataUrlTree = '';
|
||||||
@ -129,6 +130,7 @@ class TreeMultiselectField extends TreeDropdownField {
|
|||||||
$properties,
|
$properties,
|
||||||
array(
|
array(
|
||||||
'Title' => $title,
|
'Title' => $title,
|
||||||
|
'EmptyTitle' => $emptyTitle,
|
||||||
'Link' => $dataUrlTree,
|
'Link' => $dataUrlTree,
|
||||||
'Value' => $value
|
'Value' => $value
|
||||||
)
|
)
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
this[this.getPanel().is(':visible') ? 'closePanel' : 'openPanel']();
|
this[this.getPanel().is(':visible') ? 'closePanel' : 'openPanel']();
|
||||||
},
|
},
|
||||||
setTitle: function(title) {
|
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.find('.treedropdownfield-title').html(title);
|
||||||
this.data('title', title); // separate view from storage (important for search cancellation)
|
this.data('title', title); // separate view from storage (important for search cancellation)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user