Overlay.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. if (typeof window.RadControlsNamespace == "undefined")
  2. {
  3. window.RadControlsNamespace = {};
  4. }
  5. if (
  6. typeof(window.RadControlsNamespace.Overlay) == "undefined" ||
  7. typeof(window.RadControlsNamespace.Overlay.Version) == null ||
  8. window.RadControlsNamespace.Overlay.Version < 1.1
  9. )
  10. {
  11. window.RadControlsNamespace.Overlay = function (element)
  12. {
  13. if (!this.SupportsOverlay())
  14. {
  15. return;
  16. }
  17. this.Element = element;
  18. this.Shim = document.createElement("IFRAME");
  19. this.Shim.src="javascript:'';";
  20. this.Element.parentNode.insertBefore(this.Shim, this.Element);
  21. if (element.style.zIndex > 0)
  22. {
  23. this.Shim.style.zIndex = element.style.zIndex - 1;
  24. }
  25. this.Shim.style.position = "absolute";
  26. this.Shim.style.border = "0px";
  27. this.Shim.frameBorder = 0;
  28. this.Shim.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
  29. this.Shim.disabled = "disabled";
  30. }
  31. window.RadControlsNamespace.Overlay.Version = 1.1;// update in the header IF also
  32. RadControlsNamespace.Overlay.prototype.SupportsOverlay = function()
  33. {
  34. return (RadControlsNamespace.Browser.IsIE);
  35. }
  36. RadControlsNamespace.Overlay.prototype.Update = function ()
  37. {
  38. if (!this.SupportsOverlay())
  39. {
  40. return;
  41. }
  42. this.Shim.style.top = this.ToUnit(this.Element.style.top);
  43. this.Shim.style.left = this.ToUnit(this.Element.style.left);
  44. this.Shim.style.width = this.Element.offsetWidth + "px";
  45. this.Shim.style.height = this.Element.offsetHeight + "px";
  46. // this.Shim.style.border = "0px solid red";
  47. }
  48. RadControlsNamespace.Overlay.prototype.ToUnit = function (value)
  49. {
  50. if (!value) return "0px";
  51. return parseInt(value) + "px";
  52. }
  53. RadControlsNamespace.Overlay.prototype.Dispose = function ()
  54. {
  55. if (!this.SupportsOverlay())
  56. {
  57. return;
  58. }
  59. if (this.Shim.parentNode)
  60. {
  61. this.Shim.parentNode.removeChild(this.Shim);
  62. }
  63. this.Element = null;
  64. this.Shim = null;
  65. }
  66. }
  67. //BEGIN_ATLAS_NOTIFY
  68. if (typeof(Sys) != "undefined")
  69. {
  70. if (Sys.Application != null && Sys.Application.notifyScriptLoaded != null)
  71. {
  72. Sys.Application.notifyScriptLoaded();
  73. }
  74. }
  75. //END_ATLAS_NOTIFY