includes/clientside/static/fadefilter.js
changeset 869 58bc29c14a4d
parent 694 43367c66d869
child 907 44851d7e9bda
equal deleted inserted replaced
868:75dcd8cf6232 869:58bc29c14a4d
    12   if(IE)
    12   if(IE)
    13     nofade = true;
    13     nofade = true;
    14   if ( !opacVal )
    14   if ( !opacVal )
    15     opacVal = 70;
    15     opacVal = 70;
    16   darkener_index[layerid] = ( typeof(darkener_index[layerid]) == 'number' ) ? darkener_index[layerid] + 1 : 1;
    16   darkener_index[layerid] = ( typeof(darkener_index[layerid]) == 'number' ) ? darkener_index[layerid] + 1 : 1;
    17   if(document.getElementById(layerid))
    17   if(document.getElementById(layerid) && !document.getElementById(layerid).destroying)
    18   {
    18   {
    19     document.getElementById(layerid).style.zIndex = getHighestZ() + 1;
    19     document.getElementById(layerid).style.zIndex = getHighestZ() + 1;
    20     if(nofade)
    20     if(nofade)
    21     {
    21     {
    22       changeOpac(opacVal, layerid);
    22       changeOpac(opacVal, layerid);
    36         document.getElementById(layerid).style.display = 'block';
    36         document.getElementById(layerid).style.display = 'block';
    37         document.getElementById(layerid).myOpacVal = opacVal;
    37         document.getElementById(layerid).myOpacVal = opacVal;
    38         opacity(layerid, 0, opacVal, 1000);
    38         opacity(layerid, 0, opacVal, 1000);
    39       }
    39       }
    40     }
    40     }
    41   } else {
    41   }
       
    42   else if(document.getElementById(layerid) && document.getElementById(layerid).destroying)
       
    43   {
       
    44     // fade in progress - abort
       
    45     console.warn('Aborting fade');
       
    46     abortFades();
       
    47     changeOpac(opacVal, layerid);
       
    48     document.getElementById(layerid).destroying = false;
       
    49     return document.getElementById(layerid);
       
    50   }
       
    51   else
       
    52   {
    42     w = getWidth();
    53     w = getWidth();
    43     h = getHeight();
    54     h = getHeight();
    44     var thediv = document.createElement('div');
    55     var thediv = document.createElement('div');
    45     if(IE)
    56     if(IE)
    46       thediv.style.position = 'absolute';
    57       thediv.style.position = 'absolute';
   101     {
   112     {
   102       document.getElementById(layerid).style.display = 'none';
   113       document.getElementById(layerid).style.display = 'none';
   103     }
   114     }
   104     else
   115     else
   105     {
   116     {
       
   117       document.getElementById(layerid).destroying = true;
   106       var from = document.getElementById(layerid).myOpacVal;
   118       var from = document.getElementById(layerid).myOpacVal;
   107       opacity(layerid, from, 0, 1000);
   119       opacity(layerid, from, 0, 1000);
   108       setTimeout("document.getElementById('" + layerid + "').style.display = 'none';", 1000);
   120       setTimeout("if ( document.getElementById('" + layerid + "').destroying ) { document.getElementById('" + layerid + "').destroying = false; document.getElementById('" + layerid + "').style.display = 'none'; }", 1000);
   109     }
   121     }
   110   }
   122   }
   111   return document.getElementById(layerid);
   123   return document.getElementById(layerid);
   112 }
   124 }