GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

BUG: Events On assetmanager not working #3951

Closed majidh1 closed 2 years ago

majidh1 commented 2 years ago

GrapesJS version

What browser are you using?

chrome

Reproducible demo link

no link

Describe the bug

editor.on("asset:upload:start",console.log) not working

after versiom 0.17.26 not working assetmanager events asset:upload:start or asset:upload:end on editor

i am debuging code and find this

     // file: src/asset_manager/index.js 
      const { module } = this; // module is undefined
      module && module.__propEv('asset:upload:start');

Code of Conduct

artf commented 2 years ago

Fixed here https://github.com/artf/grapesjs/pull/3934/files

cusmai commented 2 years ago

Hi, still not working, events are not fired:

editor.on('asset:upload:start', () => {
      // The upload is started
      console.log('Upload started');
});
editor.on('asset:upload:end', () => {
      // The upload is ended (completed or not)
      console.log('Upload ended');
});
editor.on('asset:upload:error', (err) => {
      // Error handling
});
editor.on('asset:upload:response', (response) => {
      // Do something on response
      console.log(response);
 });