Bug Tracker

Changeset 4077

Show
Ignore:
Timestamp:
12/08/07 14:52:15 (1 year ago)
Author:
rdworth
Message:

Fixed #1927 - Add dialog open and close callbacks

Location:
trunk/ui/current
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/current/tests/uiTest.dialog.js

    r4076 r4077  
    6565            }, 
    6666            "callbacks": { 
     67                "open" : "$('#foo').dialog({\n  open: function() {\n    alert('opened');\n  }\n});", 
     68                "close" : "$('#foo').dialog({\n  close: function() {\n    alert('closed');\n  }\n});" 
    6769            }, 
    6870            "methods": { 
  • trunk/ui/current/ui.dialog.js

    r4076 r4077  
    154154            uiDialog.css({top: top, left: left}); 
    155155            uiDialog.show(); 
     156 
     157            // CALLBACK: open 
     158            var openEV = null; 
     159            var openUI = { 
     160                options: options 
     161            }; 
     162            $(this.element).triggerHandler("dialogopen", [openEV, openUI], options.open); 
    156163        }; 
    157164 
    158165        this.close = function() { 
    159166            uiDialog.hide(); 
     167 
     168            // CALLBACK: close 
     169            var closeEV = null; 
     170            var closeUI = { 
     171                options: options 
     172            }; 
     173            $(this.element).triggerHandler("dialogclose", [closeEV, closeUI], options.close); 
    160174        }; 
    161175