From 1175e5d5bf8eee4061b604c8801a392863106ca8 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 8 Jul 2023 19:30:11 +0530 Subject: [PATCH] avoid scroll for long document titles, closes #3140 --- static/js/deleteDocumentDialog.js | 12 ++++++++---- static/js/uploadDocumentDialog.js | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/static/js/deleteDocumentDialog.js b/static/js/deleteDocumentDialog.js index 05d8f55e1..f8dabbe49 100644 --- a/static/js/deleteDocumentDialog.js +++ b/static/js/deleteDocumentDialog.js @@ -3,6 +3,13 @@ pandora.ui.deleteDocumentDialog = function(files, callback) { var string = Ox._(files.length == 1 ? 'Document' : 'Documents'), + $content = Ox.Element().html( + files.length == 1 + ? Ox._('Are you sure you want to delete the document "{0}"?', [files[0].title + '.' + files[0].extension]) + : Ox._('Are you sure you want to delete {0} documents?', [files.length]) + ).css({ + overflow: 'hidden', + }), that = pandora.ui.iconDialog({ buttons: [ @@ -28,15 +35,12 @@ pandora.ui.deleteDocumentDialog = function(files, callback) { } }) ], - content: files.length == 1 - ? Ox._('Are you sure you want to delete the document "{0}"?', [files[0].title + '.' + files[0].extension]) - : Ox._('Are you sure you want to delete {0} documents?', [files.length]), + content: $content, keys: {enter: 'delete', escape: 'keep'}, title: files.length == 1 ? Ox._('Delete {0}', [string]) : Ox._('Delete {0} Documents', [files.length]) }); - return that; }; diff --git a/static/js/uploadDocumentDialog.js b/static/js/uploadDocumentDialog.js index 4672e0aff..5a9193ca0 100644 --- a/static/js/uploadDocumentDialog.js +++ b/static/js/uploadDocumentDialog.js @@ -18,7 +18,10 @@ pandora.ui.uploadDocumentDialog = function(options, callback) { $errorDialog, - $content = Ox.Element().css({margin: '16px'}), + $content = Ox.Element().css({ + margin: '16px', + overflow: 'hidden' + }), $text = $('
') .html(Ox._('Uploading {0}', [files[0].name]))