Changeset 5410


Ignore:
Timestamp:
Sep 17, 2010, 9:33:48 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1511: Get rid of script that hide form elements when selecting a menu item in IE

Location:
trunk/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/plugin/test_with_file.jsp

    r5327 r5410  
    129129    function showPredefined(event, menu)
    130130    {
    131       Menu.toggleTopMenu(document.getElementById(menu), event.clientX, event.clientY, true);
     131      Menu.toggleTopMenu(document.getElementById(menu), event.clientX, event.clientY);
    132132      event.cancelBubble = true;
    133133    }
  • trunk/www/include/scripts/menu.js

    r4889 r5410  
    4040  this.zIndex = 999;
    4141
    42   this.showTopMenu = function(menu, x, y, keepForms)
     42  this.showTopMenu = function(menu, x, y)
    4343  {
    4444    this.hideAll();
     
    4848    menu.style.zIndex = this.zIndex++;
    4949    menu.canHide = true;
    50     this.registerVisible(menu, keepForms);
     50    this.registerVisible(menu);
    5151  }
    5252 
    53   this.toggleTopMenu = function(menu, x, y, keepForms)
     53  this.toggleTopMenu = function(menu, x, y)
    5454  {
    5555    if (menu.style.display == 'none')
    5656    {
    57       this.showTopMenu(menu, x, y, keepForms);
     57      this.showTopMenu(menu, x, y);
    5858    }
    5959    else
     
    151151 
    152152 
    153   this.registerVisible = function(menu, keepForms)
     153  this.registerVisible = function(menu)
    154154  {
    155155    this.numVisible++;
    156     if (keepForms == undefined)
    157     {
    158       keepForms = !Browser.hideFormElementsForMenu;
    159     }
    160     if (this.numVisible == 1 && !keepForms) this.hideForms();
    161156    this.allVisible[this.allVisible.length] = menu;
    162157  }
     
    165160  {
    166161    this.numVisible--;
    167     if (this.numVisible == 0) this.showForms();
    168162    for (var i = this.allVisible.length-1; i >= 0; i--)
    169163    {
     
    186180  }
    187181 
    188   this.hideForms = function(win)
    189   {
    190     if (!win) win = window;
    191     var doc = win.document;
    192     for (var i = 0; i < doc.forms.length; i++)
    193     {
    194       var frm = doc.forms[i];
    195       for (var j = 0; j < frm.elements.length; j++)
    196       {
    197         frm.elements[j].style.visibility = 'hidden';
    198       }
    199     }
    200     if (win.frames && win.frames.length > 0)
    201     {
    202       for (var i = 0; i < win.frames.length; i++)
    203       {
    204         this.hideForms(win.frames[i]);
    205       }
    206     }
    207   }
    208 
    209   this.showForms = function(win)
    210   {
    211     if (!win) win = window;
    212     var doc = win.document;
    213     for (i = 0; i < doc.forms.length; i++)
    214     {
    215       var frm = doc.forms[i];
    216       for (var j = 0; j < frm.elements.length; j++)
    217       {
    218         frm.elements[j].style.visibility = 'inherit';
    219       }
    220     }
    221     if (win.frames && win.frames.length > 0)
    222     {
    223       for (var i = 0; i < win.frames.length; i++)
    224       {
    225         this.showForms(win.frames[i]);
    226       }
    227     }
    228   }
    229182 
    230183  this.openUrl = function(url, target)
Note: See TracChangeset for help on using the changeset viewer.