fix #1746 (Manage Users: Deselect button is missing)

This commit is contained in:
rolux 2013-08-02 20:29:09 +00:00
parent 42a397d84a
commit b7fc5ec7c6

View file

@ -398,13 +398,6 @@ pandora.ui.usersDialog = function() {
select: selectUsers select: selectUsers
}), }),
$formLabel = Ox.Label({
textAlign: 'center',
title: Ox._('No user selected'),
width: 212
})
.css({float: 'left', margin: '4px 2px 4px 4px'}),
$formButton = Ox.ButtonGroup({ $formButton = Ox.ButtonGroup({
buttons: [ buttons: [
{ {
@ -422,11 +415,32 @@ pandora.ui.usersDialog = function() {
selectable: true, selectable: true,
type: 'image' type: 'image'
}) })
.css({float: 'left', margin: '4px 4px 4px 2px'}) .css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({ .bindEvent({
change: selectForm change: selectForm
}), }),
$formLabel = Ox.Label({
textAlign: 'center',
title: Ox._('No user selected'),
width: 192
})
.css({float: 'left', margin: '4px 2px'}),
$deselectButton = Ox.Button({
disabled: true,
title: 'close',
tooltip: Ox._('Done'),
type: 'image'
})
.css({float: 'left', margin: '4px 4px 4px 2px'})
.bindEvent({
click: function() {
$list.options({selected: []});
selectUsers({ids: []});
}
}),
$form = Ox.Element(), $form = Ox.Element(),
$editForm, $editForm,
@ -468,8 +482,9 @@ pandora.ui.usersDialog = function() {
elements: [ elements: [
{ {
element: Ox.Bar({size: 24}) element: Ox.Bar({size: 24})
.append($formButton)
.append($formLabel) .append($formLabel)
.append($formButton), .append($deselectButton),
size: 24 size: 24
}, },
{ {
@ -847,6 +862,7 @@ pandora.ui.usersDialog = function() {
return $list.value(id); return $list.value(id);
}); });
setLabel(); setLabel();
$deselectButton.options({disabled: data.ids.length == 0});
if ($formButton.value() == 'edit') { if ($formButton.value() == 'edit') {
$form.empty(); $form.empty();
if ( if (
@ -935,7 +951,7 @@ pandora.ui.usersDialog = function() {
function setWidth() { function setWidth() {
var $form = $formButton.value() == 'edit' ? $editForm : $mailForm; var $form = $formButton.value() == 'edit' ? $editForm : $mailForm;
formWidth = $content.size(1); formWidth = $content.size(1);
$formLabel.options({width: formWidth - 44}); $formLabel.options({width: formWidth - 64});
$form && $form.options('items').forEach(function($item) { $form && $form.options('items').forEach(function($item) {
if ($item.options('id') != 'send') { if ($item.options('id') != 'send') {
$item.options({width: formWidth - 16}); $item.options({width: formWidth - 16});