jQuery: The Write Less, Do More JavaScript Library

Changeset 2473

Show
Ignore:
Timestamp:
07/25/07 00:40:22 (1 year ago)
Author:
malsup
Message:

Add support for fadeOut during unblock

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/blockUI/jquery.blockUI.js

    r2459 r2473  
    11/* 
    22 * jQuery blockUI plugin 
    3  * Version 1.29  (07/22/2007) 
     3 * Version 1.30  (07/24/2007) 
    44 * @requires jQuery v1.1.1 
    55 * 
     
    6767 
    6868// expose version number so other plugins can interogate 
    69 $.blockUI.version = 1.28; 
     69$.blockUI.version = 1.30; 
    7070 
    7171/** 
     
    190190    allowTabToLeave: 0, 
    191191    // Title attribute for overlay when using displayBox 
    192     closeMessage: 'Click to close' 
     192    closeMessage: 'Click to close', 
     193     
     194    fadeOut:  1,  // true for fadeOut unblocking 
     195    fadeTime: 400  
    193196}; 
    194197 
     
    290293        this.bind(0, el); 
    291294        var full = el == window; 
    292         if (full) { 
    293             $('body').children().filter('.blockUI').remove(); 
    294             this.pageBlock = this.pageBlockEls = null; 
    295         } 
    296         else $('.blockUI', el).remove(); 
     295        var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el); 
     296        var count = els.length; 
     297        if (full) this.pageBlock = this.pageBlockEls = null; 
     298         
     299        if ($.blockUI.defaults.fadeOut) { 
     300            els.fadeOut($.blockUI.defaults.fadeTime, function() { 
     301                if (--count <= 0) els.remove(); 
     302            }); 
     303        } 
     304        else els.remove(); 
    297305    }, 
    298306    boxRemove: function(el) {