pandora/static/js/deleteDocumentDialog.js

37 lines
1 KiB
JavaScript
Raw Normal View History

2013-03-24 09:43:24 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
pandora.ui.deleteDocumentDialog = function(file, callback) {
2013-03-24 09:43:24 +00:00
var that = pandora.ui.iconDialog({
buttons: [
Ox.Button({
id: 'keep',
title: Ox._('Keep Document')
2013-03-24 09:43:24 +00:00
}).bindEvent({
click: function() {
that.close();
}
}),
Ox.Button({
id: 'delete',
title: Ox._('Delete Document')
2013-03-24 09:43:24 +00:00
}).bindEvent({
click: function() {
that.close();
pandora.api.removeDocument({
2013-03-24 11:30:18 +00:00
id: file
2013-04-26 09:21:22 +00:00
}, callback);
2013-03-24 09:43:24 +00:00
}
})
],
content: Ox._('Are you sure you want to delete the document "{0}"?', [file]),
2013-03-24 09:43:24 +00:00
keys: {enter: 'delete', escape: 'keep'},
title: Ox._('Delete Document')
2013-03-24 09:43:24 +00:00
});
return that;
};