- Timestamp:
- 11/22/11 00:11:03 (6 months ago)
- File:
-
- 1 edited
-
trunk/inc/js/jquery.webForms.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/js/jquery.webForms.js
r15685 r15689 5 5 */ 6 6 7 $(document).ready(function() {8 7 9 $(this).addNonWebForms(); 8 (function($) { 10 9 11 // collapsable headers TODO: there is other duplicated functionlaity now and this one is not used 12 $('thead.collapsable', this).each(function() { 13 var $thead = $(this); 10 $.fn.addWebForms = function() { 14 11 15 var sImgName = $thead.hasClass('collapsed') ? 'collapse_closed' : 'collapse_open'; 12 $(this).addNonWebForms(); 13 14 // collapsable headers 15 $('.bx-form-collapsable', this).each(function() { 16 16 17 $('<img src="' + aDolImages[sImgName] + '" class="block_collapse_btn" />') 18 .prependTo($('th',$thead)) 19 .click(function() { 20 if ($thead.hasClass('collapsed')) { 17 var eFormSection = $(this); 18 19 if (eFormSection.hasClass('bx-form-js-processed')) 20 return; 21 22 eFormSection.addClass('bx-form-js-processed'); 23 24 var fCallback = function() { 25 26 if (eFormSection.hasClass('bx-form-collapsed')) { 27 21 28 // show 22 $(this).attr('src', aDolImages['collapse_open']); 23 $thead.removeClass('collapsed').next('tbody').fadeIn(400); 29 30 eFormSection.removeClass('bx-form-collapsed'); 31 32 if (eFormSection.hasClass('bx-form-section-hidden')) { 33 $('.bx-form-section-content', eFormSection).hide(); 34 eFormSection.removeClass('bx-form-section-hidden'); 35 } 36 37 $('.bx-form-section-content', eFormSection).slideDown(function () { 38 eFormSection.removeClass('bx-form-section-hidden'); 39 }); 40 24 41 } else { 42 25 43 // hide 26 $(this).attr('src', aDolImages['collapse_closed']); 27 $thead.addClass('collapsed').next('tbody').fadeOut(400); 44 45 eFormSection.addClass('bx-form-collapsed'); 46 47 $('.bx-form-section-content', eFormSection).slideUp(function () { 48 eFormSection.addClass('bx-form-collapsed bx-form-section-hidden'); 49 }); 28 50 } 29 });30 });31 });32 51 33 (function($){ 52 }; 53 54 $('<u class="bx-form-section-toggler"></u>').prependTo($('legend', eFormSection)); 55 $('legend', eFormSection).click(fCallback); 56 }); 57 58 }; 59 60 })(jQuery); 61 62 63 (function($) { 34 64 35 65 $.fn.addNonWebForms = function() { 66 36 67 $("input", this).each(function() { 37 68 … … 129 160 130 161 })(jQuery); 162
Note: See TracChangeset
for help on using the changeset viewer.