Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The whole JS file is wrapped in the new conflict-avoiding function thingy:
(function($) {
...
})(jQuery)
But the jQuery window popupWindow plugin is wrapped like that too...which I think is superfluous, and in fact causing a bug where when I click the share link I get a whole window as opposed to the nice popup.
Patch on the way...
Comment | File | Size | Author |
---|---|---|---|
#1 | simpleshare_js_1096398_1.patch | 6.91 KB | stevetweeddale |
Comments
Comment #1
stevetweeddale CreditAttribution: stevetweeddale commentedPatch made with git format-patch --no-prefix ...still working out the proper way of doing things in git land!
Comment #2
stevetweeddale CreditAttribution: stevetweeddale commentedComment #3
Rob_Feature CreditAttribution: Rob_Feature commentedHmm...something wrong with the patch. Trying to see what you mean and make the change though...will roll into dev soon
Comment #4
Rob_Feature CreditAttribution: Rob_Feature commentedA new patch against HEAD would be nifty if you see an issue (I was sorta guessing at what I was fixing since I don't know js well at all)
//Edit// Nope, that didn't do it. Would love a new patch.
Comment #5
stevetweeddale CreditAttribution: stevetweeddale commentedYeah, sorry about patch weirdness - I'm still trying to get my head around the workflow. Theoretically, creating a patch with format-patch means that the maintainer can just apply it with git am, leaving the patch author details intact in the git history.
Looking at them, I don't think my IDE's white space fixing makes for easily readable patches though.
But anyway, the JS actually looks fine now. All that the code I quoted above does is allow you to use $ for jQuery anywhere between the {}, without potentially conflicting with other JS libraries that might give the $ special meaning. So you've wrapped your $(document).ready function and your popupWindow plugin in that function separately now, which is fine - all I was doing was wrapping the whole file once... either way is fine I believe. I think the problem before was nesting it.
Thanks!
Comment #6
Rob_Feature CreditAttribution: Rob_Feature commentedI'll test more today. It seems that in my limited testing I'm not getting the popup as you suggest earlier. Are you?
Comment #7
stevetweeddale CreditAttribution: stevetweeddale commentedHmm, could be a caching issue? But yeah, it's working fine my end now.