settings.js 1.4 KB

1234567891011121314151617181920212223242526272829
  1. $(function() {
  2. window.swfupload_label_heights = {};
  3. window.swfupload_wrapper_getting_smaller = {};
  4. $('#swfupload-settings-form label').each(function() {
  5. window.swfupload_label_heights[$(this).text()] = $(this).parent().find('.swf-nodetype-wrapper').height();
  6. $(this).parent().find('.swf-nodetype-wrapper').height(0);
  7. window.swfupload_wrapper_getting_smaller[$(this).text()] = false;
  8. });
  9. $('#swfupload-settings-form label, .swf-harmonica-arrow').css({'cursor':'pointer'}).click(function() {
  10. var content = $(this).parent().find('.swf-nodetype-wrapper').stop();
  11. var label = content.parent().find('label').text();
  12. var height = window.swfupload_label_heights[label];
  13. var arrow = $(this).parent().find('.swf-harmonica-arrow');
  14. var current_height = $(this).parent().find('.swf-nodetype-wrapper').height();
  15. if (content.css("display") == 'none' || window.swfupload_wrapper_getting_smaller[label]) {
  16. window.swfupload_wrapper_getting_smaller[label] = false;
  17. arrow.addClass('south');
  18. content.css({'height':(current_height == height ? 0 : current_height) + 'px', 'display':'block'}).animate({'height':height + 'px'}, 1000);
  19. } else {
  20. arrow.removeClass('south');
  21. window.swfupload_wrapper_getting_smaller[label] = true;
  22. content.animate({'height':'0px'}, 1000, function() {
  23. $(this).css({'display':'none', 'height':height + 'px'});
  24. });
  25. };
  26. });
  27. });