Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow wider modal dialogs. #939

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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