Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
text.module
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
14 Jan 2013 at 22:56 UTC
Updated:
29 Jul 2014 at 21:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
larowlanInline with #1737148: Explicitly declare all JS dependencies, don't use drupal_add_js
File should be declared as a library with dependency on jquery and attached using library, instead of js.
Comment #2
nick_schuch commentedInitial patch containing:
- Creation of hook.
- Update of text.js reference.
Comment #3
nick_schuch commentedComment #4
larowlanTested manually, looks good to me
Screenshots

Note this will conflict with #1704864: Add a "Required" and "Show by default" option for "Text area with a summary" field/widget. so one of the two will need a re-roll. Probably better to make it this one as the other is a larger patch.
Comment #5
larowlan@nod_ pointed out we need the jquery.once dependency too
Comment #6
larowlanand also, we don't need the jquery.form dependency
Comment #7
nick_schuch commentedHave updated the patch with the refined dependancies.
Comment #8
nod_it's jquery.once the dependency name, not drupal.once :)
Comment #9
nick_schuch commentedWoops. Thanks nod_!
Comment #10
larowlanGood to go
Comment #11
webchickCommitted and pushed to 8.x, thanks!
However, I'm wondering if we need to put some babysitting code in here. This is at least the 3rd or 4th time we've caught one of these. If hook_library_info() is actually supposed to be required, it seems like we ought to throw a notice or something when a library is accessed out of band? Could we open up a follow-up (if it doesn't already exist) to discuss?
Comment #12
webchickComment #13
larowlanFollow up is #1890912: Consider possibility of throwing a warning when js is attached without a library (and assoc dependency chain).