dont fail with no entities
This commit is contained in:
parent
73f5a4cb10
commit
35da74a24b
1 changed files with 8 additions and 8 deletions
|
@ -396,20 +396,20 @@ pandora.ui.entitiesDialog = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectEntities() {
|
function selectEntities() {
|
||||||
var text = Ox.formatCount(
|
var entitiesLength = ui.entitiesSelection[type]
|
||||||
ui.entitiesSelection[type].length,
|
? ui.entitiesSelection[type].length
|
||||||
Ox._('entity'),
|
: 0,
|
||||||
Ox._('entities')
|
text = Ox.formatCount(entitiesLength, Ox._('entity'), Ox._('entities'))
|
||||||
) + ' ' + Ox._('selected');
|
+ ' ' + Ox._('selected');
|
||||||
$list.options({selected: ui.entitiesSelection[type] || []})
|
$list.options({selected: ui.entitiesSelection[type] || []})
|
||||||
renderEntity();
|
renderEntity();
|
||||||
$itemMenu[
|
$itemMenu[
|
||||||
ui.entitiesSelection[type].length ? 'enableItem' : 'disableItem'
|
entitiesLength ? 'enableItem' : 'disableItem'
|
||||||
]('delete');
|
]('delete');
|
||||||
$itemMenu.setItemTitle('delete', Ox._('Delete {0}...', [
|
$itemMenu.setItemTitle('delete', Ox._('Delete {0}...', [
|
||||||
Ox._(ui.entitiesSelection[type].length < 2 ? 'Entity' : 'Entities')
|
Ox._(entitiesLength < 2 ? 'Entity' : 'Entities')
|
||||||
]));
|
]));
|
||||||
$deselectButton[ui.entitiesSelection[type].length ? 'show' : 'hide']();
|
$deselectButton[entitiesLength ? 'show' : 'hide']();
|
||||||
renderForm();
|
renderForm();
|
||||||
$itemStatus.html(text[0].toUpperCase() + text.slice(1));
|
$itemStatus.html(text[0].toUpperCase() + text.slice(1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue