summaryrefslogtreecommitdiff
path: root/misc/form.js
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-04-27 20:19:38 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-04-27 20:19:38 +0000
commitfc7283235bb9e5ae4300714d03c0bf3723f4792b (patch)
tree0dc443ba5dc1f74fbfc5ad5762c7c7a556232b73 /misc/form.js
parent031ba7d66533b3bb6e1ceb1cc834e9af9b1a3c71 (diff)
downloadbrdo-fc7283235bb9e5ae4300714d03c0bf3723f4792b.tar.gz
brdo-fc7283235bb9e5ae4300714d03c0bf3723f4792b.tar.bz2
#444402 follow-up by kkaefer: Fix autocomplete, enforce code style for anonymous JS functions.
Diffstat (limited to 'misc/form.js')
-rw-r--r--misc/form.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/misc/form.js b/misc/form.js
index 39c605978..9f916c345 100644
--- a/misc/form.js
+++ b/misc/form.js
@@ -1,10 +1,10 @@
// $Id$
-(function($) {
+(function ($) {
/**
* Retrieves the summary for the first element.
*/
-$.fn.getSummary = function() {
+$.fn.getSummary = function () {
var callback = this.data('summaryCallback');
return (this[0] && callback) ? $.trim(callback(this[0])) : '';
};
@@ -16,14 +16,14 @@ $.fn.getSummary = function() {
* Either a function that will be called each time the summary is
* retrieved or a string (which is returned each time).
*/
-$.fn.setSummary = function(callback) {
+$.fn.setSummary = function (callback) {
var that = this;
// To facilitate things, the callback should always be a function. If it's
// not, we wrap it into an anonymous function which just returns the value.
if (typeof callback != 'function') {
var val = callback;
- callback = function() { return val; };
+ callback = function () { return val; };
}
return this
@@ -31,7 +31,7 @@ $.fn.setSummary = function(callback) {
// To prevent duplicate events, the handlers are first removed and then
// (re-)added.
.unbind('formUpdated.summary')
- .bind('formUpdated.summary', function() {
+ .bind('formUpdated.summary', function () {
that.trigger('summaryUpdated');
})
// The actual summaryUpdated handler doesn't fire when the callback is
@@ -43,7 +43,7 @@ $.fn.setSummary = function(callback) {
* Sends a 'formUpdated' event each time a form element is modified.
*/
Drupal.behaviors.formUpdated = {
- attach: function(context) {
+ attach: function (context) {
// These events are namespaced so that we can remove them later.
var events = 'change.formUpdated click.formUpdated blur.formUpdated keyup.formUpdated';
$(context)
@@ -52,17 +52,17 @@ Drupal.behaviors.formUpdated = {
.find(':input').andSelf().filter(':input')
// To prevent duplicate events, the handlers are first removed and then
// (re-)added.
- .unbind(events).bind(events, function() {
+ .unbind(events).bind(events, function () {
$(this).trigger('formUpdated');
});
}
};
Drupal.behaviors.multiselectSelector = {
- attach: function(context, settings) {
+ attach: function (context, settings) {
// Automatically selects the right radio button in a multiselect control.
$('.multiselect select:not(.multiselectSelector-processed)', context)
- .addClass('multiselectSelector-processed').change(function() {
+ .addClass('multiselectSelector-processed').change(function () {
$('.multiselect input:radio[value="' + this.id.substr(5) + '"]')
.attr('checked', true);
});
@@ -74,12 +74,12 @@ Drupal.behaviors.multiselectSelector = {
* Automatically display the guidelines of the selected text format.
*/
Drupal.behaviors.filterGuidelines = {
- attach: function(context) {
+ attach: function (context) {
$('.filter-guidelines:not(.filter-guidelines-processed)', context)
.addClass('filter-guidelines-processed')
.find('label').hide()
.parents('.filter-wrapper').find('select.filter-list')
- .bind('change', function() {
+ .bind('change', function () {
$(this).parents('.filter-wrapper')
.find('.filter-guidelines-item').hide()
.siblings('#filter-guidelines-' + this.value).show();