File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
AdobeStockImageAdminUi/view/adminhtml/web/js/components/grid/column/preview Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1010 <resources >
1111 <resource id =" Magento_Backend::admin" >
1212 <resource id =" Magento_Backend::system" >
13- <resource id =" Magento_AdobeStockAsset::adobe_stock_asset" title =" Adobe Stock" translate =" title" sortOrder =" 5" >
14- <resource id =" Magento_AdobeStockAsset::actions" title =" Actions" translate =" title" >
13+ <resource id =" Magento_AdobeStockAsset::adobe_stock_asset" title =" Adobe Stock WebAPI " translate =" title" sortOrder =" 5" >
14+ <resource id =" Magento_AdobeStockAsset::actions" title =" WebAPI Actions" translate =" title" >
1515 <resource id =" Magento_AdobeStockAsset::actions_delete" title =" Delete" translate =" title" />
1616 <resource id =" Magento_AdobeStockAsset::actions_save" title =" Save" translate =" title" />
1717 <resource id =" Magento_AdobeStockAsset::actions_view" title =" View" translate =" title" />
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ define([
180180 if ( path !== '' ) {
181181 this . imageDirectory ( ) . locateNode ( path ) ;
182182 }
183- this . selectRecord ( this . getRecordFromMediaGalleryProvider ( assetDetails . path ) ) ;
183+ this . selectRecordFromMediaGalleryProvider ( assetDetails . path ) ;
184184 } . bind ( this ) ) ;
185185
186186 } ,
@@ -203,23 +203,27 @@ define([
203203 } ,
204204
205205 /**
206- * Get image data by image file name
206+ * Select record by image file name
207207 *
208208 * @param {String } path
209- * @returns {null|Object }
210209 */
211- getRecordFromMediaGalleryProvider : function ( path ) {
212- var report = null ;
210+ selectRecordFromMediaGalleryProvider : function ( path ) {
211+ var subscription ;
213212
214- this . imageItems . each ( function ( item ) {
215- if ( item . path === path ) {
216- report = item ;
213+ subscription = this . imageItems . subscribe ( function ( items ) {
214+ subscription . dispose ( ) ;
215+ items . each ( function ( item ) {
216+ if ( item . path === path ) {
217+ this . selectRecord ( item ) ;
217218
218- return false ;
219- }
220- } ) ;
219+ return false ;
220+ }
221+ } . bind ( this ) ) ;
222+ } . bind ( this ) ) ;
221223
222- return report ;
224+ setTimeout ( function ( ) {
225+ subscription . dispose ( ) ;
226+ } , 1500 ) ;
223227 } ,
224228
225229 /**
You can’t perform that action at this time.
0 commit comments