Skip to content

Commit

Permalink
Merge pull request #939 from girder/wider-modal-dialogs
Browse files Browse the repository at this point in the history
Allow wider modal dialogs.
  • Loading branch information
manthey authored Aug 23, 2022
2 parents 22e566a + a38304f commit 085cc81
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Improvements
- Add a general filter control to item lists ([938](../../pull/938))
- Item list modal dialogs are wider ([939](../../pull/939))

## 1.16.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ div.large_image_thumbnail
div.large_image_container
display inline-block
min-width 160px
div.large_image_container+span
white-space nowrap
[large_image_columns="2"]
div.large_image_container
min-width 320px
Expand Down Expand Up @@ -63,3 +65,10 @@ ul.g-item-list
width inherit
.li-item-list-filter
padding-left 12px
@media (min-width: 768px)
.modal-dialog.li-item-list-dialog
width inherit
@media (min-width: 900px)
.modal-dialog.li-item-list-dialog
width 70%
max-width 1000px
9 changes: 6 additions & 3 deletions girder/girder_large_image/web_client/views/itemList.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ wrap(ItemListWidget, 'initialize', function (initialize, settings) {
});

wrap(ItemListWidget, 'render', function (render) {
this.$el.closest('.modal-dialog').addClass('li-item-list-dialog');

/* Chrome limits the number of connections to a single domain, which means
* that time-consuming requests for thumbnails can bind-up the web browser.
* To avoid this, limit the maximum number of thumbnails that are requested
Expand Down Expand Up @@ -182,8 +184,8 @@ wrap(ItemListWidget, 'render', function (render) {
this._setFilter = () => {
let val = this._generalFilter;
let filter;
if (val !== undefined && val !== '') {
const columns = (this._confList() || {}).columns || [];
const columns = (this._confList() || {}).columns || [];
if (val !== undefined && val !== '' && columns.length) {
filter = [];
val.match(/"[^"]*"|'[^']*'|\S+/g).forEach((phrase) => {
if (!phrase.length) {
Expand Down Expand Up @@ -318,7 +320,8 @@ wrap(ItemListWidget, 'render', function (render) {
}
});
}
$('a[g-item-cid="' + item.cid + '"]>i', parent).before(elem);
var inner = $('<span>').html($('a[g-item-cid="' + item.cid + '"]').html());
$('a[g-item-cid="' + item.cid + '"]', parent).empty().append(elem, inner);
_loadMoreImages(parent);
});
}
Expand Down

0 comments on commit 085cc81

Please sign in to comment.