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(); $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
) )

View File

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