codef0rmer/angular-dragdrop — pull request #104 by leftyhitchens (2014-05-22 22:00:50+00:00)
Title: Fixed issue with multiple levels of json objects

So I am writing an application that needs drag and drop and I wrote a call back with the following signature:

startDrag(event, ui, data){
.....
}

Where data was expected to be a json object. and in my html code I wrote something like this:

onStart:'startCallback(item, {foo: 1, bar: 2})'

This code resulted in a parse error. I pinpointed the issue to be in the callEventCallback function where the code is parsing the arguments based a comma delimited split. This caused problems, because of course the json object is comma delimited, and so my change was to accomodate json arguments to the callback functions. I added 2 test cases, which when applied without my change will clearly illustrate the problem.

Additionally, I used my beautify plugin to format the code, that is why it is showing substantially more changes than are meaningful. I can undo the formatting if that will make things easier, but the important parts are lines 51-83.