Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
We can remove the -processed hacks now that once is in core.
Comment | File | Size | Author |
---|---|---|---|
#5 | ctools-utilize-once-1505432-v3.patch | 16.15 KB | litwol |
#3 | ctools-utilize-once-1505432-v2.patch | 16.14 KB | litwol |
#1 | ctools-utilize-once-1505432.patch | 9.67 KB | litwol |
Comments
Comment #1
litwol CreditAttribution: litwol commentedThings to note:
* I've converted js/*.js files to use .once() to the best of my understanding, except stylizer.js
* stylizer.js is relatively more complicated than other files, so i am leaving it to be tackled last once i receive confirmation that changes i've introduced to other files are on the correct track.
* Be thorough when reviewing & testing this patch as I have negligible experience with ctools js [framework?].
* this patch is a little longer than it should have been due to realigned code blocks after removing/introducing new scope ({}) blocks.
Comment #2
tim.plunkettFrom the patch context, its not clear why this was changed.
This is now indented too far
Maybe this is a good section for
var $this = $(this);
since its used 4 timesPossibly here too? $(this) is used twice, as well as $(button) which is the same.
And 3 times here as well.
Nice clean-up!
Comment #3
litwol CreditAttribution: litwol commented* Stylizer.js still largely unchanged. still needs to be addressed with .once() rewrite.
* integrated above feedback
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedShould probably use ctools-dependent rather than just ctools -- too much risk of accidental collision. It should probably never have been 'ctools-processed' in the first place.
Comment #5
litwol CreditAttribution: litwol commentedMinor patch update, integrating feedback from #4.
Next i will upload converted stylizer.js.
Comment #6
litwol CreditAttribution: litwol commentedas per conversation on irc, stylizer.js is not to be addressed as part of this patch. there is other work that needs to be done on stylizer.js before (if ever) converting it to .once(). more info here: #1275992: Removing anonymous functions in stylizer.js
Comment #7
tim.plunkettCommitted!
http://drupalcode.org/project/ctools.git/commit/5d7edd1
Thanks litwol.