event triggers previous state attributes to remote storage
Question
I'm trying to extract the change in src of an image and store it in the remote storage using Storage Manager, by using the following code
editor.on('stop:open-assets', model => {
editor.StorageManager.get('remote').set({
params: {
metakey: 'logo-src',
val: editor.getSelected().attributes.src
},
},console.log("storage assets",editor.getSelected().attributes.src))
})
The issue I'm facing is that when I change the image for the first time, it gives me the desired output in the console-> storage assets image2.jpg but the params are not affected, in fact no trigger it made to the params
The second time I change the image to to image1.jpg, i get the desired output in the console-> storage assets image1.jpg but the params affected contain values of the previous state and return image2.jpg
hence on, every time i change to a new image the params return the previous state. This behaviour is unusual. I didn't face an issue like these while dealing with other events
Answers (2)
had to initialize autosave to false and autoload to true and call editor.store at the end of the event. issue resolved
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1904
Get change in property float
I'm trying to listen to the change in the 'float' property whether it was shifted to the 'left' or 'right' or 'none' in Style Manager using...
Issue #1044
change src for image element in model
hello when a image block drop to editor i hide the default asset manager and display my custom asset manager: fot this i have no problem.bu...
Issue #701
Modifying a component in the editor clears the model content
What I'm trying to achieve: I have special "data-" attributes on some of the components I pull into the editor. When one of these is modifi...
Issue #849
Ability to unload and destroy the editor instance or reload the config options?
In my use case, I'm trying to change the store and load URLs used by the remote storage manager dynamically. As far as I can tell, the edit...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.