From: Marek Stępniowski Date: Fri, 15 Aug 2008 00:31:36 +0000 (+0200) Subject: Fixed jquery.cuteform.js and added it to compress settings. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/c6956aa35ce0fe5ff17a1f8a3f4f2d51d886cd0d?ds=sidebyside Fixed jquery.cuteform.js and added it to compress settings. --- diff --git a/media/js/jquery.cuteform.js b/media/js/jquery.cuteform.js index 7993634f8..ee1a15857 100644 --- a/media/js/jquery.cuteform.js +++ b/media/js/jquery.cuteform.js @@ -1,13 +1,12 @@ (function($) { - $.fn.cuteform = function() { - $('form.cuteform', this).each(function(index) { + $(document).ready(function() { + $('form.cuteform').each(function(index) { var formLabels = $('label', this) var maxWidth = 0; - + formLabels.each(function() { - maxWidth = max(maxWidth, this); - }); - formLabels.width(maxWidth); + maxWidth = Math.max(maxWidth, $(this).width()); + }).css({display: 'inline-block'}).width(maxWidth); }); - }; -})(jQuery) \ No newline at end of file + }); +})(jQuery); \ No newline at end of file diff --git a/settings.py b/settings.py index 83bd3c312..829eaf8bf 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.cuteform.js'), + 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/jquery.cuteform.js',), 'output_filename': 'js/all.min.js', } }