fix #1218 (error log dialog lacks reload button)
This commit is contained in:
parent
860ffd49d7
commit
fa6b65e235
1 changed files with 24 additions and 10 deletions
|
@ -3,9 +3,24 @@
|
|||
'use strict';
|
||||
|
||||
pandora.ui.logsDialog = function() {
|
||||
|
||||
var height = Math.round((window.innerHeight - 48) * 0.9),
|
||||
width = Math.round(window.innerWidth * 0.9),
|
||||
numberOfLogs = 0,
|
||||
|
||||
$reloadButton = Ox.Button({
|
||||
disabled: true,
|
||||
title: 'redo',
|
||||
tooltip: Ox._('Reload'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'left', margin: '4px'})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
$reloadButton.options({disabled: true});
|
||||
Ox.Request.clearCache('findLogs');
|
||||
$list.reloadList(true);
|
||||
}
|
||||
}),
|
||||
|
||||
$findSelect = Ox.Select({
|
||||
items: [
|
||||
|
@ -111,11 +126,9 @@ pandora.ui.logsDialog = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
init: function(data) {
|
||||
numberOfLogs = data.items;
|
||||
$status.html(
|
||||
Ox.formatNumber(numberOfLogs) + ' '
|
||||
+ (numberOfLogs == 1 ? 'entry' : 'entries')
|
||||
);
|
||||
$status.html(Ox.toTitleCase(
|
||||
Ox.formatCount(data.items, 'entry', 'entries')
|
||||
));
|
||||
},
|
||||
'delete': function(data) {
|
||||
pandora.api.removeLogs({ids: data.ids}, function(result) {
|
||||
|
@ -123,6 +136,9 @@ pandora.ui.logsDialog = function() {
|
|||
$list.reloadList();
|
||||
});
|
||||
},
|
||||
load: function() {
|
||||
$reloadButton.options({disabled: false});
|
||||
},
|
||||
open: function(data) {
|
||||
var value = $list.value(Ox.last(data.ids)),
|
||||
$dialog;
|
||||
|
@ -174,10 +190,8 @@ pandora.ui.logsDialog = function() {
|
|||
elements: [
|
||||
{
|
||||
element: Ox.Bar({size: 24})
|
||||
.append($status)
|
||||
.append(
|
||||
$findElement
|
||||
),
|
||||
.append($reloadButton)
|
||||
.append($findElement),
|
||||
size: 24
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue