diff --git a/notebook/static/base/js/dialog.js b/notebook/static/base/js/dialog.js index 9a4e5c150..99d37440e 100644 --- a/notebook/static/base/js/dialog.js +++ b/notebook/static/base/js/dialog.js @@ -212,72 +212,106 @@ define(function(require) { }; var edit_attachments = function (options) { - var message = - "Current cell attachments"; + // This shows the Edit Attachments dialog. This dialog allows the + // user to delete attachments. We show a list of attachments to + // the user and he can mark some of them for deletion. The deletion + // is applied when the 'Apply' button of this dialog is pressed. + var message; + var attachments_list; + if (Object.keys(options.attachments).length == 0) { + message = "There are no attachments for this cell."; + attachments_list = $('
'); + } else { + message = "Current cell attachments"; - var attachments_list = $('
') - .addClass('list_container') - .append( - $('
') - .addClass('row list_header') + attachments_list = $('
') + .addClass('list_container') .append( $('
') - .text('Attachments') - ) - ); - - var refresh_attachments_list = function() { - $(attachments_list).find('.att_row').remove(); - for (var key in options.attachments) { - var mime = Object.keys(options.attachments[key])[0]; - var delete_btn = $('