add confirm dialog while deleting annotations
This commit is contained in:
parent
277bbe45fb
commit
212ad3cee0
1 changed files with 39 additions and 0 deletions
|
@ -21,6 +21,7 @@ pandora.ui.editor = function(data) {
|
|||
censoredIcon: pandora.site.cantPlay.icon,
|
||||
censoredTooltip: Ox._(pandora.site.cantPlay.text),
|
||||
clickLink: pandora.clickLink,
|
||||
confirmDeleteDialog: confirmDeleteDialog,
|
||||
cuts: data.cuts || [],
|
||||
duration: data.duration,
|
||||
enableDownload: pandora.hasCapability('canDownloadVideo') >= data.rightslevel || data.editable,
|
||||
|
@ -442,6 +443,44 @@ pandora.ui.editor = function(data) {
|
|||
|
||||
pandora._dontSelectResult = false;
|
||||
|
||||
function confirmDeleteDialog(options, callback) {
|
||||
const subject = options.items.length == 1 ? Ox._('annotation') : Ox._('annotations')
|
||||
const $dialog = pandora.ui.iconDialog({
|
||||
buttons: [
|
||||
Ox.Button({
|
||||
id: 'cancel',
|
||||
title: Ox._('Cancel')
|
||||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
$dialog.close();
|
||||
}
|
||||
}),
|
||||
Ox.Button({
|
||||
id: 'delete',
|
||||
title: Ox._('Delete')
|
||||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
$dialog.close();
|
||||
callback()
|
||||
}
|
||||
})
|
||||
],
|
||||
content: Ox._(
|
||||
'Are you sure you want delete {0} {1}',
|
||||
[options.items.length, subject]
|
||||
),
|
||||
height: 96,
|
||||
keys: {enter: 'delete', escape: 'cancel'},
|
||||
title: Ox._(
|
||||
'Delete {0} {1}', [options.items.length, subject]
|
||||
)
|
||||
});
|
||||
$dialog.open()
|
||||
return $dialog
|
||||
}
|
||||
|
||||
function getAnnotationById(id) {
|
||||
var annotation
|
||||
data.annotations.forEach(layer => {
|
||||
|
|
Loading…
Reference in a new issue