Skip to content

Commit

Permalink
ENGCOM-6507: Adobe stock integration Issue-761: Highlight the selecte…
Browse files Browse the repository at this point in the history
…d image in the grid #25864
  • Loading branch information
VladimirZaets authored Dec 23, 2019
2 parents 4cf6034 + 98b21a3 commit 7268854
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
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

0 comments on commit 7268854

Please sign in to comment.