Skip to content

Commit 145f183

Browse files
committed
Fix code style
1 parent 1132e60 commit 145f183

File tree

1 file changed

+16
-9
lines changed
  • AdobeStockImageAdminUi/view/adminhtml/web/js/components/grid/column

1 file changed

+16
-9
lines changed

AdobeStockImageAdminUi/view/adminhtml/web/js/components/grid/column/image-preview.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,31 @@ define([
6262
initialize: function () {
6363
this._super().initView();
6464
$(window).on('fileDeleted.enhancedMediaGallery', function () {
65+
this.updateIsDownloadedField();
6566
this.reloadAdobeGrid();
6667
}.bind(this));
6768
$(window).on('folderDeleted.enhancedMediaGallery', function () {
68-
this.actions().getAssetDetails(this.displayedRecord().id).then(function (assetDetails) {
69-
var record = this.displayedRecord();
70-
71-
if (assetDetails.length === 0) {
72-
record['is_downloaded'] = 0;
73-
this.displayedRecord(record);
74-
}
75-
}.bind(this));
76-
69+
this.updateIsDownloadedField();
7770
this.reloadAdobeGrid();
7871
}.bind(this));
7972

8073
return this;
8174
},
8275

76+
/**
77+
* Update is_downloaded filed for displayed record
78+
*/
79+
updateIsDownloadedField: function () {
80+
var record = this.displayedRecord();
81+
82+
this.actions().getAssetDetails(this.displayedRecord().id).then(function (assetDetails) {
83+
if (assetDetails.length === 0) {
84+
record['is_downloaded'] = 0;
85+
this.displayedRecord(record);
86+
}
87+
}.bind(this));
88+
},
89+
8390
/**
8491
* Initialize child components
8592
*

0 commit comments

Comments
 (0)