You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
apeisa
changed the title
InputfieldPageAutocomplete moving "delete item" click handler into init method
Moving InputfieldPageAutocomplete's "delete item" click handler into init method?
May 20, 2015
I think we could do that, though not 100% sure it would be fully backwards compatible. I look at it and think "why is that in document.ready rather than in the dedicated class?" When I wrote the code there, it's always possible I was just being dumb, but it's also possible there was a good reason. So before we move it, I'd want to see if there's some way to make it work with what you are trying to do there. For instance, what if we changed this:
Sorry for the late reply. This fixes it also. While I have hard time seeing why moving the handler into init might cause problems, I'll trust your instinct and would be very happy with the change you proposed.
For some reason click handler for removing rows is initialized on document ready instead of init method. In normal pw admin use this doesn't matter, but we are building product where we are loading inputfields through ajax. Moving handler from row https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.js#L247 inside init method in same file naturally fixes the problem and should be fully backwards compatible solution. $(document).ready(function() wouldn't be necessary at all.
Any hope to get that moved?
The text was updated successfully, but these errors were encountered: