From: Marek Stępniowski Date: Thu, 14 Aug 2008 15:48:07 +0000 (+0200) Subject: Added custom jquery plugin jquery.cuteform.js. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/cff42cc9b51c24b47583c8b8a3a5ae5a6b837f43?ds=sidebyside Added custom jquery plugin 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', } }