Hi,

I have just released the FastClick module, a Drupal library for fastclick.js. I know Writer theme makes use of it, and I think it would be nice if could be integrated with it.

A part of the common advantages of using the Libraries API, this would make the library optional for the theme, as the javascript code wouldn't be included unless the library is installed by the user:

if (($library = libraries_load('fastclick')) && !empty($library['loaded'])) {
    drupal_add_js(drupal_get_path('theme', 'writer') . '/attach_fastclick.js');
}

(where attach_fastclick.js is where you create the event listener).

Comments

Pere Orga’s picture

Issue summary: View changes

Minor.

Pere Orga’s picture

Issue summary: View changes

Minor.

Pere Orga’s picture

Issue summary: View changes

Fix code snippet.

bryanbraun’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

I've thought about this a bit. I agree, using Libraries is a good pattern, especially for large sites with a lot of complexity. However, this theme is designed for use on smaller blog sites, and I'd really like to keep writer as simple to set up as possible, which means leaving fastclick integrated. Maybe I'll reconsider at some point, but I feel pretty good about that for now.

Thanks for checking though, and thanks for your contributed modules.