updated core to 7.58 (right after the site was hacked)
This commit is contained in:
25
sites/all/modules/examples/field_example/field_example.js
Normal file
25
sites/all/modules/examples/field_example/field_example.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @file
|
||||
* Javascript for Field Example.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides a farbtastic colorpicker for the fancier widget.
|
||||
*/
|
||||
(function ($) {
|
||||
Drupal.behaviors.field_example_colorpicker = {
|
||||
attach: function(context) {
|
||||
$(".edit-field-example-colorpicker").live("focus", function(event) {
|
||||
var edit_field = this;
|
||||
var picker = $(this).closest('div').parent().find(".field-example-colorpicker");
|
||||
|
||||
// Hide all color pickers except this one.
|
||||
$(".field-example-colorpicker").hide();
|
||||
$(picker).show();
|
||||
$.farbtastic(picker, function(color) {
|
||||
edit_field.value = color;
|
||||
}).setColor(edit_field.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user