JohnLouderback / GDB

Generic Data Binder (GDB) for jQuery is a framework agnostic and extremely easy to use 2 way data binder. GDB binds views and models in realtime with live two-way binding and no hefty framework necessary.
http://gdb.thewebdev.guru/
Apache License 2.0
87 stars 11 forks source link

Bug with rootElementSelectorString #19

Closed nevf closed 10 years ago

nevf commented 10 years ago

Hi John, I've just downloaded the latest version to use in another app and found a problem with rootElementSelectorString. If I don't specify it I get an error in the IFE where options.rootElementSelectorString = el_get(options.rootElement); because el_get() is returning an element and rootElementSelectorString needs to be a selector string.

I'm also confused re. the use of rootElementSelectorString as the docs indicate it is now deprecated and therefore I would assume if it wasn't specified it would be ignored.

JohnLouderback commented 10 years ago

I've made a commit that should remedy the issue, but I have not yet been able to test it. Let me know if this fix improves your experience.

Thanks, -John

nevf commented 10 years ago

@JohnLouderback Yes that resolves the issue, thanks. But what about the issue that rootElementSelectorString is deprecated, but still being used.

JohnLouderback commented 10 years ago

@nevf It's deprecated, but not yet phased out. The easier way to still have the non-favored rootElementSelectorString support still available while introducing the new rootElement was to simply detect if rootElement is being used, and if it is, then replace the previous usages of rootElementSelectorString with the value of rootElement. Just a temporary hack until some version from now where I feel more comfortable just ripping out rootElementSelectorString.