Skip to content

Commit 4be048d

Browse files
Merge pull request #89 from asad-rafter/CLD-287-remember-MLW-path
open last accessed folder
2 parents 9740240 + 8d86b6b commit 4be048d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • cartridges/bm_cloudinary_pd/cartridge/static/default/experience/editors/cloudinary

cartridges/bm_cloudinary_pd/cartridge/static/default/experience/editors/cloudinary/mediaSelector.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@
116116
showError('Wrong asset type.');
117117
} else {
118118
isAssetRestricted(config.assetInfoUrl, asset).then(((restricted) => {
119+
if (asset.resource_type === 'image') {
120+
localStorage.setItem('imagePath', asset.public_id.substring(0, asset.public_id.lastIndexOf('/')));
121+
} else {
122+
localStorage.setItem('videoPath', asset.public_id.substring(0, asset.public_id.lastIndexOf('/')));
123+
}
124+
119125
if (!restricted) {
120126
emit({
121127
type: 'sfcc:valid',
@@ -159,7 +165,7 @@
159165
} else {
160166
show.folder = {
161167
resource_type: config.type,
162-
path: null
168+
path: config.type === 'image' ? localStorage.getItem('imagePath') : localStorage.getItem('videoPath')
163169
};
164170
}
165171

0 commit comments

Comments
 (0)