Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with deleting from asset manager #560

Merged
merged 2 commits into from
Nov 23, 2017

Conversation

ryandeba
Copy link
Contributor

No description provided.

@@ -79,7 +79,7 @@ module.exports = require('./AssetView').extend({
* @private
* */
onRemove(e) {
e.stopPropagation();
e.stopImmediatePropagation();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that e.stopPropagation() would work, but found this after a quick google search: https://stackoverflow.com/questions/5457915/how-can-i-stop-event-propagation-with-backbone-js

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this is actually working 👍

@@ -1,9 +1,9 @@
module.exports = require('./AssetView').extend({

events: {
'click [data-toggle=asset-remove]': 'onRemove',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find it documented anywhere, but these events seem to fire in the order they are registered. The onRemove function needs to run before onClick so that the event propagation can be stopped.

@ryandeba
Copy link
Contributor Author

This is the fix #549

@artf artf merged commit e84c34c into GrapesJS:dev Nov 23, 2017
@artf
Copy link
Member

artf commented Nov 23, 2017

hey Ryan ping me on discord chat pls

@lock
Copy link

lock bot commented Sep 17, 2019

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.

@lock lock bot added the outdated label Sep 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants