Ticket #1176: CenterDialogs.patch

File CenterDialogs.patch, 0.8 kB (added by guest, 3 months ago)

Added new 'centered' option for dialogs. When true, causes dialogs to be centered on the screen. (Ideally, there should really be a global config option to set where dialogs are positioned for consistency.)

  • XinhaDialog.js

     
    3939  this.modal = (options && options.modal === false) ? false : true; 
    4040  this.closable = (options && options.closable === false) ? false : true; 
    4141  this.layer = (options && options.layer) ? options.layer : 0; 
     42  this.centered = (options && options.centered === true) ? true : false; 
    4243   
    4344   
    4445  if (Xinha.is_ie) 
     
    314315      rootElemStyle.top =  parseInt(this.size.top,10) + 'px'; 
    315316      rootElemStyle.left = parseInt(this.size.left,10) + 'px'; 
    316317    } 
    317     else if (this.editor.btnClickEvent) 
     318    else if (this.editor.btnClickEvent && !this.centered) 
    318319    { 
    319320      var btnClickEvent = this.editor.btnClickEvent; 
    320321      if (rootElemStyle.position == 'absolute')