Changeset 4619

Show
Ignore:
Timestamp:
07/31/07 21:22:25 (1 year ago)
Author:
gregmac
Message:

Add callback support to javascript modal functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.3/amp_conf/htdocs/admin/common/interface.dim.js

    r4448 r4619  
    44        /** Dim the screen, and show a modal box (a div)  
    55        */ 
    6         function freepbx_modal_show(divID) { 
     6        function freepbx_modal_show(divID,callback) { 
    77                // hack: find the "real" height: the height of the header, plus either nav or wrapper, whichever is longer 
    88                obj = $('#'+divID); 
     
    2727                        // show box 
    2828                        obj.fadeIn(300); 
     29                        if (callback) { 
     30                                callback(); 
     31                        } 
    2932                }); 
    3033        } 
    3134         
    3235        /** Hide the modal box, but don't get rid of the dimmed screen */ 
    33         function freepbx_modal_hide(divID) { 
     36        function freepbx_modal_hide(divID, callback) { 
    3437                $('#__dimScreen').css('cursor','wait'); 
    35                 $('#'+divID).fadeOut(300); 
     38                $('#'+divID).fadeOut(300, callback); 
    3639        } 
    3740         
    3841        /** Close the modal box, undim the screen */ 
    39         function freepbx_modal_close(divID) { 
     42        function freepbx_modal_close(divID, callback) { 
    4043                obj = $('#'+divID); 
    4144                if (obj.css('display') != 'block') { 
     
    5053                                // show select boxes, IE shows them overtop of everything 
    5154                                hideSelects(false); 
     55                        } 
     56 
     57                        if (callback) { 
     58                                callback(); 
    5259                        } 
    5360                });