File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
AdobeStockImageAdminUi/view/adminhtml/web/js/components/grid/column/preview Expand file tree Collapse file tree 2 files changed +18
-13
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,28 @@ define([
203203 } ,
204204
205205 /**
206- * Get image data by image file name
206+ * Select record by image file name
207207 *
208208 * @param {String } path
209209 * @returns {null|Object }
210210 */
211- getRecordFromMediaGalleryProvider : function ( path ) {
212- var report = null ;
211+ selectRecordFromMediaGalleryProvider : function ( path ) {
212+ var subscription ;
213213
214- this . imageItems . each ( function ( item ) {
215- if ( item . path === path ) {
216- report = item ;
214+ subscription = this . imageItems . subscribe ( function ( items ) {
215+ subscription . dispose ( ) ;
216+ items . each ( function ( item ) {
217+ if ( item . path === path ) {
218+ this . selectRecord ( item ) ;
217219
218- return false ;
219- }
220- } ) ;
220+ return false ;
221+ }
222+ } . bind ( this ) ) ;
223+ } . bind ( this ) ) ;
221224
222- return report ;
225+ setTimeout ( function ( ) {
226+ subscription . dispose ( ) ;
227+ } , 1500 ) ;
223228 } ,
224229
225230 /**
You can’t perform that action at this time.
0 commit comments