Remove widget: When data doesnt exists try to find the el in nodes of the engine#272
Closed
marcodejongh wants to merge 1 commit intogridstack:masterfrom
Closed
Remove widget: When data doesnt exists try to find the el in nodes of the engine#272marcodejongh wants to merge 1 commit intogridstack:masterfrom
marcodejongh wants to merge 1 commit intogridstack:masterfrom
Conversation
Closed
Member
|
I've added this code to master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi There,
I'm working on a meteor packaged version of this plugin now everything mostly works fine.
Except I can't get
remove_widgetto work because Meteor is a bit too aggressive with cleaning up the data of the elements.I've created meteor/meteor#5573 for that but it probably will take forever for the Meteor team to look into it.
The workaround I came up with isn't really damaging or wrong and actually makes the code more robust.
If for some reason the widget you try to remove doesn't have the
_gridstack_nodedata it tries to look up the node in the nodes array of the engine. You might even consider adding the lookup to all methods. Although the data not existing will probably only ever occur in theremove_widgetfunction