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

Adobe stock integration Issue-761: Highlight the selected image in the grid #25864

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
11 changes: 11 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/grid/columns/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ define([
return record.css || {};
},

/**
* Get is active record
*
* @param {Object} record - Data to be preprocessed.
*
* @returns {Boolean}
*/
getIsActive: function (record) {
return this.previewComponent().visibleRecord() === record._rowIndex || false;
},

/**
* Expand image preview
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/
-->
<div class="masonry-image-block" ko-style="$col.getStyles($row())" attr="'data-id': $col.getId($row())">
<div class="masonry-image-block" ko-style="$col.getStyles($row())" css="{'active': $col.getIsActive($row())}" attr="'data-id': $col.getId($row())">
<img attr="src: $col.getUrl($row())" css="$col.getClasses($row())" click="function(){ expandPreview($row()) }" data-role="thumbnail"/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@admin__masonry_grid_image__space: 20px;
@admin__masonry_grid_background_color: #fff;
@admin__masonry_overlay_background_color: #507dc8;
@admin__masonry_grid_active_image_border_color: #558dd6;

& when (@media-common = true) {
.masonry-image {
Expand All @@ -27,6 +28,15 @@
margin: @admin__masonry_grid_image__space/2;
overflow: hidden;

.masonry-image-block {
&.active {
img {
border: 2px @admin__masonry_grid_active_image_border_color solid;
padding: 1px;
}
}
}

img {
cursor: pointer;
height: 100%;
Expand Down