| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 // $Id: calendar_colorpicker.js,v 1.1.4.3 2008/11/21 22:04:56 karens Exp $ 2 /** 3 * Implementation of hook_elements. 4 * 5 * Much of the colorpicker code was adapted from the Colorpicker module. 6 * That module has no stable release yet nor any D6 branch. 7 */ 8 /* 9 * Bind the colorpicker event to the form element 10 */ 11 Drupal.behaviors.calendarColorpicker = function (context) { 12 13 // do we have multiple calendar_colors? 14 if ($("div.calendar_colorpicker").size() > 0) { 15 16 // loop over each calendar_color type 17 $("div.calendar_colorpicker").each(function() { 18 19 // create the farbtastic colorpicker 20 var farb = $.farbtastic(this); 21 22 // get the id of the current matched colorpicker wrapper div 23 var id = $(this).attr("id"); 24 25 // get the calendar_color_textfields associated with this calendar_color 26 $("input.calendar_colorfield").filter("." + id).each(function () { 27 // set the background colors of all of the textfields appropriately 28 farb.linkTo(this); 29 30 // when clicked, they get linked to the farbtastic colorpicker that they are associated with 31 $(this).click(function () { 32 farb.linkTo(this); 33 }); 34 35 }); 36 37 }); 38 } 39 }; 40
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |