Databases Reference
In-Depth Information
044 //Find the objects visible state before making dialog window (used to restore if
necessary)
045 uiw._values.beforeShowVisible = uiw._elements.$element.is(':visible');
046 $.console.log('beforeShowVisible: ', uiw._values.beforeShowVisible);
047
048 //Create Dialog window
049 //Creating each time so that we can easily restore its visible state if necessary
050 uiw._elements.$element.dialog({
051 modal: uiw.options.modal,
052 closeOnEscape: uiw.options.closeOnEscape,
053 title: uiw.options.title,
054 //Options below Can be made configurable if required
055 width: 'auto',
056 //Event Binding
057 beforeClose: function(event, ui) { $(this).trigger('cfpluginapexdialogbeforeclose',
{event: event, ui: ui}); },
058 close: function(event, ui) {
059 //Destroy the jQuery UI elements so that it displays as if dialog had not been
applied
060 uiw._elements.$element.dialog( "destroy" );
061
062 //Move out of wrapper and back into original position
063 uiw._elements.$wrapper.before(uiw._elements.$element);
064
065 //Show only if previous state was show
066 if ((uiw._values.beforeShowVisible && uiw.options.onCloseVisibleState == 'prev')
|| uiw.options.onCloseVisibleState == 'show'){
067 uiw._elements.$element.show();
068 }
069 else {
070 uiw._elements.$element.hide();
071 }
072
073 //Trigger custom APEX Event
074 uiw._elements.$element.trigger('cfpluginapexdialogclose', {event: event, ui: ui});
075 },
076 create: function(event, ui) { $(this).trigger('cfpluginapexdialogcreate', {event:
event, ui: ui}); }
077 });
078
079 //Move into wrapper
080 uiw._elements.$wrapper.append(uiw._elements.$element.parent('.ui-dialog'));
081
082 $.console.groupEnd(consoleGroupName);
083 }, //_init
084
085 /**
086 * Set private widget variables
087 */
088 _setWidgetVars: function(){
089 var uiw = this;
090
Search WWH ::




Custom Search