I'm using this module as a dependency of another module. I need to include colorpickers in the html which is returned by AHAH. I needed to make a couple of changes to get it to work.

1. Add all the colorpicker CSS and Javascript to the initial form.
2. Modify the colopicker.js file to check to see if there are any colorpickers on the page. (see patch)
3. Modify the colorpicker.js file to allow the colorpickers to be reinitialised after the ahah callback has fired. (see patch)
4. Add some javascript to to the ahah callback to fire the reinitialisation of the colorpickers.
...

  $output .= '<script>var t=setTimeout(colorpicker_init, "100");</script>'; //reinitialise the colorpickers.  We need to give a small delay to wait for the ahah form to be rebuilt.
  print drupal_to_js(array('data' => $output, 'status' => true));

I'd appreciate it if this patch could be committed.

CommentFileSizeAuthor
#1 colorpicker.js_.patch844 bytesaaron1234nz
colorpicker.js_.patch888 bytesaaron1234nz

Comments

aaron1234nz’s picture

StatusFileSize
new844 bytes

this patch is better

dwees’s picture

Done. Modified patch slightly to fix formatting slightly (because of indenting formatting I had done poorly myself). Completely understand the idea of the fix.

Dave

dwees’s picture

Assigned: Unassigned » dwees
Status: Active » Fixed
aaron1234nz’s picture

thanks!

Babalu’s picture

subscibing

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.