From cff42cc9b51c24b47583c8b8a3a5ae5a6b837f43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Thu, 14 Aug 2008 17:48:07 +0200 Subject: [PATCH 1/1] Added custom jquery plugin jquery.cuteform.js. --- media/js/jquery.cuteform.js | 13 +++++++++++++ settings.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 media/js/jquery.cuteform.js diff --git a/media/js/jquery.cuteform.js b/media/js/jquery.cuteform.js new file mode 100644 index 000000000..7993634f8 --- /dev/null +++ b/media/js/jquery.cuteform.js @@ -0,0 +1,13 @@ +(function($) { + $.fn.cuteform = function() { + $('form.cuteform', this).each(function(index) { + var formLabels = $('label', this) + var maxWidth = 0; + + formLabels.each(function() { + maxWidth = max(maxWidth, this); + }); + formLabels.width(maxWidth); + }); + }; +})(jQuery) \ No newline at end of file diff --git a/settings.py b/settings.py index 8baaf69d1..83bd3c312 100644 --- a/settings.py +++ b/settings.py @@ -97,7 +97,7 @@ COMPRESS_CSS = { COMPRESS_JS = { 'all': { 'source_filenames': ('js/jquery.js', 'js/jquery.autocolumn.js', 'js/jquery.autocomplete.js', - 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js',), + 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/jquery.cuteform.js'), 'output_filename': 'js/all.min.js', } } -- 2.20.1