Skip to content

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
marcodejongh:master
Closed

Remove widget: When data doesnt exists try to find the el in nodes of the engine#272
marcodejongh wants to merge 1 commit intogridstack:masterfrom
marcodejongh:master

Conversation

@marcodejongh
Copy link

Hi There,

I'm working on a meteor packaged version of this plugin now everything mostly works fine.
Except I can't get remove_widget to 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_node data 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 the remove_widget function

@marcodejongh marcodejongh changed the title When data doesnt exists try to find the el in nodes of the engine Remove widget: When data doesnt exists try to find the el in nodes of the engine Nov 3, 2015
@marcodejongh marcodejongh mentioned this pull request Nov 3, 2015
@troolee
Copy link
Member

troolee commented Feb 20, 2016

I've added this code to master

@troolee troolee closed this Feb 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments