Skip to content

Commit 98b21a3

Browse files
ENGCOM-6507: Adobe stock integration Issue-761: Highlight the selected image in the grid #25864
- Merge Pull Request #25864 from serhiyzhovnir/magento2:adobe-stock-integration/issue-761 - Merged commits: 1. 2be7779 2. 83fadc4 3. a7f6e2d 4. ee115fe 5. 21bc869
2 parents 2863caa + 21bc869 commit 98b21a3

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

app/code/Magento/Ui/view/base/web/js/grid/columns/image.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ define([
8080
return record.css || {};
8181
},
8282

83+
/**
84+
* Get is active record
85+
*
86+
* @param {Object} record - Data to be preprocessed.
87+
*
88+
* @returns {Boolean}
89+
*/
90+
getIsActive: function (record) {
91+
return this.previewComponent().visibleRecord() === record._rowIndex || false;
92+
},
93+
8394
/**
8495
* Expand image preview
8596
*/

app/code/Magento/Ui/view/base/web/templates/grid/columns/image.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<div class="masonry-image-block" ko-style="$col.getStyles($row())" attr="'data-id': $col.getId($row())">
7+
<div class="masonry-image-block" ko-style="$col.getStyles($row())" css="{'active': $col.getIsActive($row())}" attr="'data-id': $col.getId($row())">
88
<img attr="src: $col.getUrl($row())" css="$col.getClasses($row())" click="function(){ expandPreview($row()) }" data-role="thumbnail"/>
99
</div>

app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@admin__masonry_grid_image__space: 20px;
66
@admin__masonry_grid_background_color: #fff;
77
@admin__masonry_overlay_background_color: #507dc8;
8+
@admin__masonry_grid_active_image_border_color: #558dd6;
89

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

31+
.masonry-image-block {
32+
&.active {
33+
img {
34+
border: 2px @admin__masonry_grid_active_image_border_color solid;
35+
padding: 1px;
36+
}
37+
}
38+
}
39+
3040
img {
3141
cursor: pointer;
3242
height: 100%;

0 commit comments

Comments
 (0)