Closed (fixed)
Project:
Chosen
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 Aug 2012 at 01:02 UTC
Updated:
29 Jan 2013 at 07:30 UTC
Jump to comment: Most recent file
Implement hook_library to allow other modules to initialize the library when required. Related to this issue #1476036: Move away from hook_init() and into #attached, this would allow the module to be used as an API and on it's own with hook_init().
I'll have a patch later this evening.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1713584-hook_library.patch | 2.57 KB | minoroffense |
Comments
Comment #1
minoroffense commentedHere's the patch. It creates two library entries.
1) The chosen library itself
2) The files required to run the chosen.js supplied by the module.
Comment #2
Cyclodex commentedThanks for the patch, I will test it later.
I think we should release a 7.x-1.2 and move this patch into a 1.3-dev or even 7.x-2.x-dev version.
Comment #3
minoroffense commentedThat's fine with me. The change shouldn't affect any existing sites since it's the exact same drupal_add_js code as was there originally, just packed up into hook_library.
I've done some testing on my own and I haven't found any issues so far. If you need help testing or need a testing environment with the changes applied I can send you a Drupal site and db to try out.
Thanks!
Comment #4
shadcn commentedInteresting. I've created a 7.x-2.x branch. Assigning.
Comment #5
kalman.hosszu commentedComment #6
kalman.hosszu commentedI committed the modification to 2.x branch.