Fixing deselect failing to change field title

This commit is contained in:
Daniel Hensby 2015-12-15 11:27:22 +00:00
parent e0d7400aea
commit e443a10a5e
2 changed files with 4 additions and 2 deletions

View File

@ -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
)

View File

@ -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)