Skip to content

Commit 7e4ba44

Browse files
authored
Merge pull request #213 from DigitalSlideArchive/harden-icon-additions
Refactor how controls are found and modified.
2 parents 7c1fd17 + 3f97f83 commit 7e4ba44

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

histomicsui/web_client/views/itemList.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ wrap(ItemListWidget, 'render', function (render) {
2222
root.$el.find('.g-item-list-entry').each(function () {
2323
var parent = $(this);
2424
parent.find('.g-hui-quarantine').remove();
25-
parent.append($('<a class="g-hui-quarantine"><span>Q</span></a>').attr({
25+
parent.find('a[class^=g-]:last').after($('<a class="g-hui-quarantine"><span>Q</span></a>').attr({
2626
'g-item-cid': $('[g-item-cid]', parent).attr('g-item-cid'),
2727
title: 'Move this item to the quarantine folder'
2828
}));
@@ -64,11 +64,9 @@ wrap(ItemListWidget, 'render', function (render) {
6464
const brandName = (settings['histomicsui.brand_name'] || '');
6565
const webrootPath = (settings['histomicsui.webroot_path'] || '');
6666
for (let ix = 0; ix < this.collection.length; ix++) {
67-
if (!this.$el.find('.g-item-list li:eq(' + ix + ') .g-hui-open-link').length && this.collection.models[ix].attributes.largeImage) {
68-
this.$el.find('.g-item-list li:eq(' + ix + ')>.g-item-size').before(
69-
`<a class="g-hui-open-link" title="Open in ${brandName}" href="${webrootPath}#?image=${this.collection.models[ix].id}" target="_blank">
70-
<i class="icon-link-ext"></i>
71-
</a>`
67+
if (!this.$el.find('.g-item-list li.g-item-list-entry:eq(' + ix + ') .g-hui-open-link').length && this.collection.models[ix].attributes.largeImage) {
68+
this.$el.find('.g-item-list li.g-item-list-entry:eq(' + ix + ') a[class^=g-]:last').after(
69+
`<a class="g-hui-open-link" title="Open in ${brandName}" href="${webrootPath}#?image=${this.collection.models[ix].id}" target="_blank"><i class="icon-link-ext"></i></a>`
7270
);
7371
}
7472
}

0 commit comments

Comments
 (0)