Changeset 1023


Ignore:
Timestamp:
08/23/08 15:41:55 (11 years ago)
Author:
ray
Message:

#1268 [new-dialogs] [IE] striped line around absolutely positioned elements rendered above dialogs
#1176 removed global config option for modality
#1264 removed alert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new-dialogs/modules/Dialogs/XinhaDialog.js

    r1020 r1023  
    6161      this.closable = globalOptions.closable; 
    6262    } 
    63     if (typeof(globalOptions.modal) != 'undefined') { 
    64       this.modal = globalOptions.modal; 
    65     } 
    6663    if (typeof(globalOptions.closeOnEscape) != 'undefined') { 
    6764      this.closeOnEscape = globalOptions.closeOnEscape; 
    6865    } 
    69   } 
    70  
    71   /* NOTE: Support for modeless dialogs is incomplete and all current plugins 
    72   /* use modal dialogs, so I'm deactivating modeless dialogs until these issues are fixed 
    73   /* Outstanding issues with modeless dialogs: 
    74   /*   - it's possible new modeless dialogs will be opened behind other dialogs 
    75   /*   - there's no visual indication as to which modeless dialog is frontmost and has focus 
    76   /*   - closing one dialog does not cause the dialog behind it to gain focus 
    77   /*   - no active modeless dialog is set until one is clicked, i.e., none is set by just calling show() 
    78   /*   - you can type in a form field of a dialog even when it's not frontmost (and doing so doesn't activate it) 
    79   /* See discussion on ticket #1264: http://xinha.webfactional.com/ticket/1264 
    80   */ 
    81   if (this.modal == false) { 
    82     this.modal = true; 
    83     alert("Support for modeless dialogs is currently incomplete and has been turned off. " 
    84           + "See comments at: http://xinha.webfactional.com/ticket/1264"); 
    8566  } 
    8667 
     
    192173  rootElem.appendChild(this.buttons); 
    193174 
    194   if (this.closeOnEscape) 
     175  if (this.closable && this.closeOnEscape) 
    195176  { 
    196177    Xinha._addEvent(document, 'keypress', function(ev) { 
    197178      if (ev.keyCode == 27) // ESC key 
    198179      { 
    199         if (Xinha.Dialog.activeModeless == dialog || dialog.modal) 
    200         { 
    201           dialog.hide(); 
    202           return true; 
    203         } 
     180        if (Xinha.Dialog.activeModeless == dialog || dialog.modal) 
     181        { 
     182          dialog.hide(); 
     183          return true; 
     184        } 
    204185      } 
    205186    }); 
     
    359340 
    360341    //rootElemStyle.display   = ''; 
    361     Xinha.Dialog.fadeIn(this.rootElem); 
     342    Xinha.Dialog.fadeIn(this.rootElem, 100,function() { 
     343      //this is primarily to work around a bug in IE where absolutely positioned elements have a frame that renders above all #1268 
     344      //but could also be seen as a feature ;) 
     345      if (modal) 
     346      { 
     347        var input = dialog.rootElem.getElementsByTagName('input'); 
     348        for (var i=0;i<input.length;i++) 
     349        { 
     350          if (input[i].type == 'text') 
     351          { 
     352            input[i].focus(); 
     353            break; 
     354          } 
     355        } 
     356      } 
     357    }); 
    362358    var dialogHeight = rootElem.offsetHeight; 
    363359    var dialogWidth = rootElem.offsetWidth; 
     
    10971093 * @param {Number} step Fade this much per step (percent) 
    10981094 */ 
    1099 Xinha.Dialog.fadeIn = function(el,endOpacity,delay,step) 
     1095Xinha.Dialog.fadeIn = function(el,endOpacity,callback, delay,step) 
    11001096{ 
    11011097    delay = delay || 1; 
     
    11131109        el.op += step; 
    11141110        Xinha.Dialog.setOpacity(el,op); 
    1115         el.timeOut = setTimeout(function(){Xinha.Dialog.fadeIn(el,endOpacity,delay,step);},delay); 
     1111        el.timeOut = setTimeout(function(){Xinha.Dialog.fadeIn(el, endOpacity, callback, delay, step);},delay); 
    11161112    } 
    11171113    else 
     
    11201116        el.op = endOpacity; 
    11211117        el.timeOut = null; 
     1118        if (typeof callback == 'function') callback.call(); 
    11221119    } 
    11231120} 
Note: See TracChangeset for help on using the changeset viewer.