File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
AdobeStockImageAdminUi/view/adminhtml/web/js/components/grid/column Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments