update metadata dialog

This commit is contained in:
rolux 2013-02-28 11:58:28 +05:30
parent bcd3876ec1
commit 128e9fb962

View file

@ -15,6 +15,20 @@ pandora.ui.metadataDialog = function(data) {
formWidth = getFormWidth(), formWidth = getFormWidth(),
imdb, imdb,
$loading = Ox.Element().append(
$('<img>')
.attr({src: Ox.UI.getImageURL('symbolLoadingAnimated')})
.css({
position: 'absolute',
width: '32px',
height: '32px',
left: 0,
top: 0,
right: 0,
bottom: 0,
margin: 'auto'
})
),
$confirmDialog, $confirmDialog,
$selectAllButton, $selectAllButton,
$selectNoneButton, $selectNoneButton,
@ -31,12 +45,23 @@ pandora.ui.metadataDialog = function(data) {
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'close', id: 'close',
title: 'Close' title: 'Not Now'
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
that.close(); that.close();
} }
}),
Ox.Button({
distabled: true,
id: 'update',
title: 'Update IMDb Id...'
})
.bindEvent({
click: function() {
that.close();
pandora.$ui.idDialog = pandora.ui.idDialog(data).open();
}
}) })
], ],
content: Ox.Element() content: Ox.Element()
@ -56,7 +81,7 @@ pandora.ui.metadataDialog = function(data) {
), ),
fixedSize: true, fixedSize: true,
height: 128, height: 128,
keyboard: {enter: 'close', escape: 'close'}, keyboard: {enter: 'update', escape: 'close'},
removeOnClose: true, removeOnClose: true,
title: 'Update Metadata', title: 'Update Metadata',
width: 304 width: 304
@ -66,6 +91,18 @@ pandora.ui.metadataDialog = function(data) {
function updateDialog() { function updateDialog() {
return Ox.Dialog({ return Ox.Dialog({
buttons: [ buttons: [
Ox.Button({
distabled: true,
id: 'switch',
title: 'Update IMDb Id...'
})
.bindEvent({
click: function() {
that.close();
pandora.$ui.idDialog = pandora.ui.idDialog(data).open();
}
})
{},
Ox.Button({ Ox.Button({
id: 'cancel', id: 'cancel',
title: 'Don\'t Update' title: 'Don\'t Update'
@ -78,7 +115,7 @@ pandora.ui.metadataDialog = function(data) {
Ox.Button({ Ox.Button({
disabled: true, disabled: true,
id: 'update', id: 'update',
title: 'Update' title: 'Update...'
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -87,20 +124,7 @@ pandora.ui.metadataDialog = function(data) {
}) })
], ],
closeButton: true, closeButton: true,
content: Ox.Element().append( content: $loading,
$('<img>')
.attr({src: Ox.UI.getImageURL('symbolLoadingAnimated')})
.css({
position: 'absolute',
width: '32px',
height: '32px',
left: 0,
top: 0,
right: 0,
bottom: 0,
margin: 'auto'
})
),
height: dialogHeight, height: dialogHeight,
maximizeButton: true, maximizeButton: true,
minHeight: 256, minHeight: 256,
@ -126,7 +150,6 @@ pandora.ui.metadataDialog = function(data) {
$confirmDialog.close(); $confirmDialog.close();
} }
}), }),
{},
Ox.Button({ Ox.Button({
id: 'update', id: 'update',
title: 'Update' title: 'Update'
@ -359,7 +382,7 @@ pandora.ui.metadataDialog = function(data) {
Ox.isArray(type) ? [] : '' Ox.isArray(type) ? [] : ''
); );
}); });
that.disableButtons(); that.options({content: $loading}).disableButtons();
pandora.api.edit(edit, function(result) { pandora.api.edit(edit, function(result) {
that.close(); that.close();
pandora.updateItemContext(); pandora.updateItemContext();