X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/cff42cc9b51c24b47583c8b8a3a5ae5a6b837f43..ea79d284625af50707b7b637d9ee8e8e672a6c19:/media/js/jquery.cuteform.js?ds=sidebyside 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