CMenu.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2011
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. /*-----------------------------------------------------------------------------------------------------
  13. Class : CMenu
  14. Description :
  15. -----------------------------------------------------------------------------------------------------*/
  16. var g_ownerDocument = null;
  17. function CMenu(id,style) {
  18. this.m_htmlContainer = document.body;
  19. this.m_bVisible = false;
  20. this.m_id = id;
  21. this.m_htmlDivElement = null;
  22. this.m_parent = null;
  23. this.m_menuItems = [];
  24. this.m_style = style;
  25. this.m_callback = null;
  26. this.m_observers = new CObserver(this);
  27. this.m_oCV = null;
  28. }
  29. function CMenu_setHTMLContainer(container) {
  30. this.m_htmlContainer = container;
  31. g_ownerDocument = document.all ? this.m_htmlContainer.document : this.m_htmlContainer.ownerDocument;
  32. }
  33. function CMenu_getHTMLContainer() {
  34. return this.m_htmlContainer;
  35. }
  36. function CMenu_setParent(parent) {
  37. this.m_parent = parent;
  38. }
  39. function CMenu_getParent() {
  40. return this.m_parent;
  41. }
  42. function CMenu_getId() {
  43. return this.m_id;
  44. }
  45. function CMenu_getHTMLDiv() {
  46. return this.m_htmlDivElement;
  47. }
  48. function CMenu_create() {
  49. var newElement = document.all ? this.m_htmlContainer.document.createElement("div") : this.m_htmlContainer.ownerDocument.createElement("div");
  50. if(typeof this.getStyle() == "object") {
  51. newElement.className = this.getStyle().getNormalState();
  52. }
  53. //Only set display=block when needed, because it causes flickering in Mozilla
  54. newElement.style.display = "none";
  55. newElement.style.visibility = "hidden";
  56. newElement.style.position = "absolute";
  57. newElement.id = this.m_id;
  58. //append the new menu
  59. this.m_htmlContainer.appendChild(newElement);
  60. //create a reference to it
  61. this.m_htmlDivElement = newElement;
  62. }
  63. function CMenu_executeMenuCallback()
  64. {
  65. if (menu && menu.executeCallback) {
  66. menu.executeCallback();
  67. }
  68. }
  69. function CMenu_draw() {
  70. if(this.m_htmlContainer == null) {
  71. return;
  72. }
  73. if(this.m_htmlDivElement == null) {
  74. this.create();
  75. }
  76. var html='';
  77. if(this.m_menuItems.length == 0) {
  78. if(this.m_callback != null) {
  79. setTimeout(CMenu_executeMenuCallback, 1000);
  80. // build a html div with a wait cursor
  81. html='<table class="menuItem_normal" CELLPADDING="0" CELLSPACING="0">';
  82. html += '<tr>';
  83. html += '<td>';
  84. html += '<img width="16" height="16" src="../common/images/tv_loading.gif"/>';
  85. html += '</td>';
  86. html += '<td nowrap="nowrap" align="left">';
  87. if (this.m_oCV && RV_RES.GOTO_LOADING) {
  88. html += RV_RES.GOTO_LOADING;
  89. }
  90. else if(typeof gUIFrameWorkMenuLoadingMessage != 'undefined') {
  91. html += gUIFrameWorkMenuLoadingMessage;
  92. } else {
  93. html += '...';
  94. }
  95. html += '</td>';
  96. html += '</tr>';
  97. html += '</table>';
  98. }
  99. } else {
  100. //add the items
  101. var i=0;
  102. html='<table CELLPADDING="0" CELLSPACING="0">';
  103. for (i=0; i < this.m_menuItems.length; i++) {
  104. if(this.m_menuItems[i].isVisible()) {
  105. html += '<tr><td>';
  106. html += this.m_menuItems[i].draw();
  107. html += '</td></tr>';
  108. }
  109. }
  110. html += '</table>';
  111. }
  112. try
  113. {
  114. this.m_htmlDivElement.innerHTML = html;
  115. // attach the event handlers
  116. this.attachEvents();
  117. }
  118. catch (e)
  119. {
  120. }
  121. this.updateCoords();
  122. // update hidden iframe
  123. var iFrameId = "uiFrameworkHiddenIframe" + this.m_id;
  124. var isNS7 = ((!document.all) && (document.getElementById)) ? true : false;
  125. setTimeout('updateIframeCoords("' + iFrameId + '", "' + this.m_htmlDivElement.id + '", ' + isNS7 + ')',50);
  126. }
  127. function CMenu_updateCoords() {
  128. var myParent = this.getParent();
  129. var mnu = this.m_htmlDivElement;
  130. if(mnu != null)
  131. {
  132. var myDocument = document.all ? this.m_htmlContainer.document : this.m_htmlContainer.ownerDocument;
  133. //Backup the visibilty and display properties of this menu
  134. var originalVisibility = mnu.style.visibility;
  135. var originalDisplay = mnu.style.display;
  136. mnu.style.visibility = "hidden";
  137. mnu.style.display = "block";
  138. //This line is used to make sure the width of the DIV element is correct in Mozilla
  139. if(mnu.firstChild != null) {
  140. mnu.style.width = mnu.firstChild.offsetWidth;
  141. }
  142. var x=0, y=0;
  143. var db = mnu.parentNode; //db = Document body
  144. // calculate the page width
  145. var pageWidth = db.clientWidth;
  146. var pageHeight = db.clientHeight;
  147. var scrollLeft = db.scrollLeft;
  148. var scrollTop = db.scrollTop;
  149. if(myParent == null)
  150. {
  151. //If this is the main context menu...
  152. x = mnu.style.left;
  153. y = mnu.style.top;
  154. //Remove 'px' on x and y coordinates if it exists
  155. if (x.substr(x.length - 2, 2) == 'px')
  156. {
  157. x = parseInt(x.substring(0, x.length-2),10);
  158. y = parseInt(y.substring(0, y.length-2),10);
  159. }
  160. //Change the y coordinate if the menu goes below the visible page
  161. if (y + mnu.offsetHeight >= (pageHeight))
  162. {
  163. if (y - mnu.offsetHeight > 0) {
  164. y = y + scrollTop - mnu.offsetHeight;
  165. }
  166. else {
  167. y = Math.max(pageHeight - mnu.offsetHeight, 0);
  168. }
  169. }
  170. else {
  171. y = y + scrollTop;
  172. }
  173. //Change the x coordinate if the menu goes below the visible page
  174. if (x + mnu.offsetWidth >= (pageWidth))
  175. {
  176. if (x - mnu.offsetWidth > 0) {
  177. x = x + scrollLeft - mnu.offsetWidth;
  178. }
  179. else {
  180. x = Math.max(pageWidth - mnu.offsetWidth, 0);
  181. }
  182. }
  183. else {
  184. x = x + scrollLeft;
  185. }
  186. }
  187. else
  188. {
  189. //This is one of the menu items...
  190. if(!(myParent instanceof CToolbarButton) && !(myParent instanceof CMenuItem)) {
  191. return;
  192. }
  193. // make sure the parent has implemented the method "getMenuType"
  194. if(typeof myParent.getMenuType != 'function') {
  195. return;
  196. }
  197. var sParentId = this.getParent().getId();
  198. var myParentHTMLElement = myDocument.getElementById(sParentId);
  199. var myParentDropdownButton = myDocument.getElementById('menu' + sParentId);
  200. if(myParentHTMLElement == null) {
  201. return;
  202. }
  203. var current = myParentHTMLElement;
  204. // handle drop down menus
  205. if(myParent.getMenuType() == 'dropDown') {
  206. x = 0; y = myParentHTMLElement.offsetHeight;
  207. while(current != null) {
  208. x += current.offsetLeft; y += current.offsetTop;
  209. current = current.offsetParent;
  210. }
  211. // if the right side of the drop down menu extends beyond browser window viewing area, adjust accordingly
  212. if((x + mnu.offsetWidth) > (pageWidth + scrollLeft)) {
  213. x = x + myParentHTMLElement.offsetWidth - mnu.offsetWidth;
  214. if(myParentDropdownButton != null) {
  215. x = x + myParentDropdownButton.offsetWidth;
  216. }
  217. }
  218. // if the bottom of the drop down menu extends below the browser viewing area and there is enough room to draw at the top, then draw to the top
  219. if(((y + mnu.offsetHeight) > (pageHeight + scrollTop)) && (y - (mnu.offsetHeight + myParentHTMLElement.clientHeight) >= 0)) {
  220. y -= (mnu.offsetHeight + myParentHTMLElement.clientHeight);
  221. }
  222. } else if(myParent.getMenuType() == 'cascaded') {
  223. x = myParentHTMLElement.offsetWidth;
  224. while(current != null) {
  225. x += current.offsetLeft; y += current.offsetTop;
  226. current = current.offsetParent;
  227. }
  228. // if the right side of the cascaded menu extends beyond the viewing area of the browser window right side, render to the left insted of the right
  229. if((x + mnu.offsetWidth) > (pageWidth + scrollLeft)) {
  230. x -= (myParentHTMLElement.offsetWidth + mnu.offsetWidth);
  231. }
  232. // if the bottom of the cascaded menu extends beyond the bottom of the browser viewing area, draw to the top
  233. if((y + mnu.offsetHeight) > (pageHeight + scrollTop)) {
  234. y -= (mnu.offsetHeight-myParentHTMLElement.clientHeight);
  235. }
  236. }
  237. }
  238. //Restore the visibilty and display properties of this menu
  239. mnu.style.visibility = originalVisibility;
  240. mnu.style.display = originalDisplay;
  241. this.setXCoord(x);
  242. this.setYCoord(y);
  243. this.setZIndex(500);
  244. }
  245. }
  246. function CMenu_add(menuItem) {
  247. if(typeof menuItem.getObservers === "function") {
  248. var oMenuObservers = menuItem.getObservers();
  249. if (typeof oMenuObservers === "object") {
  250. oMenuObservers.attach(this, this.closeSubMenus, menuItem.onmouseover);
  251. oMenuObservers.attach(this, this.closeAllMenus, menuItem.onmouseup);
  252. oMenuObservers.attach(this, this.closeSubMenus, menuItem.onfocus);
  253. oMenuObservers.attach(this, this.closeAllMenus, menuItem.onkeypress);
  254. }
  255. }
  256. this.m_menuItems[this.m_menuItems.length] = menuItem;
  257. }
  258. function CMenu_get(index) {
  259. if(index >= 0 && index < this.getNumItems()) {
  260. return this.m_menuItems[index];
  261. }
  262. return null;
  263. }
  264. function CMenu_getNumItems() {
  265. return this.m_menuItems.length;
  266. }
  267. function CMenu_hide() {
  268. this.hideHiddenIframe();
  269. if(this.m_htmlDivElement != null) {
  270. this.m_htmlDivElement.style.visibility = "hidden";
  271. }
  272. this.m_bVisible = false;
  273. // get the actual element that spawned the menu
  274. var theControl = this.getParent();
  275. if (theControl != null && typeof theControl.setFocus == "function") {
  276. theControl.setFocus();
  277. }
  278. }
  279. function CMenu_show() {
  280. if(this.m_htmlDivElement != null) {
  281. this.m_bVisible = true;
  282. // update the x and y coords
  283. this.updateCoords();
  284. var isNS7 = ((!document.all) && (document.getElementById)) ? true : false;
  285. var iFrameId = "uiFrameworkHiddenIframe" + this.m_id;
  286. var hiddenIframeElement = document.all ? this.m_htmlContainer.document.getElementById(iFrameId) : this.m_htmlContainer.ownerDocument.getElementById(iFrameId);
  287. if (hiddenIframeElement == null) {
  288. hiddenIframeElement = this.createHiddenIFrame(iFrameId);
  289. }
  290. if(hiddenIframeElement) {
  291. hiddenIframeElement.style.display = "block";
  292. updateIframeCoords(iFrameId, this.m_htmlDivElement.id, isNS7);
  293. setTimeout('updateIframeCoords("'+iFrameId+'", "'+this.m_htmlDivElement.id+'", '+isNS7+')',50);
  294. }
  295. //Show the context menu
  296. this.m_htmlDivElement.style.display = "block";
  297. this.m_htmlDivElement.style.visibility = "visible";
  298. if (!isNS7)
  299. {
  300. try
  301. {
  302. this.m_htmlDivElement.focus();
  303. }
  304. catch (e)
  305. {
  306. }
  307. }
  308. }
  309. }
  310. function CMenu_createHiddenIFrame(iFrameId)
  311. {
  312. var container = this.getHTMLContainer();
  313. var iframeElem = document.all ? container.document.createElement("iframe") : container.ownerDocument.createElement("iframe");
  314. iframeElem.setAttribute("id",iFrameId);
  315. iframeElem.setAttribute("src",'../common/images/spacer.gif');
  316. iframeElem.setAttribute("scrolling",'no');
  317. iframeElem.setAttribute("frameborder",'0');
  318. iframeElem.style.position='absolute';
  319. iframeElem.style.minWidth='0px';
  320. iframeElem.style.minHeight='0px';
  321. iframeElem.style.left='0px';
  322. iframeElem.style.top='0px';
  323. iframeElem.style.zIndex=499;
  324. iframeElem.style.display='none';
  325. container.appendChild(iframeElem);
  326. return iframeElem;
  327. }
  328. function CMenu_isVisible() {
  329. return this.m_bVisible;
  330. }
  331. function CMenu_remove() {
  332. this.removeHiddenIframe();
  333. for(var i = 0; i < this.getNumItems(); ++i) {
  334. var currentItem = this.get(i);
  335. if(typeof currentItem.getMenu == "function" && currentItem.getMenu() != null) {
  336. currentItem.getMenu().remove();
  337. }
  338. }
  339. if(this.m_htmlContainer != null && this.m_htmlDivElement != null) {
  340. this.m_htmlContainer.removeChild(this.m_htmlDivElement);
  341. }
  342. this.m_htmlDivElement = null;
  343. this.m_bVisible = false;
  344. }
  345. function CMenu_removeHiddenIframe()
  346. {
  347. try
  348. {
  349. if (g_ownerDocument)
  350. {
  351. var hiddenIframeElement = g_ownerDocument.getElementById("uiFrameworkHiddenIframe" + this.m_id);
  352. if (hiddenIframeElement != null) {
  353. hiddenIframeElement.style.display = "none";
  354. if (hiddenIframeElement.parentNode && hiddenIframeElement.parentNode.removeChild) {
  355. hiddenIframeElement.parentNode.removeChild(hiddenIframeElement);
  356. }
  357. }
  358. }
  359. }
  360. catch(e)
  361. {
  362. }
  363. }
  364. function CMenu_hideHiddenIframe() {
  365. try
  366. {
  367. var hiddenIframeElement = g_ownerDocument.getElementById("uiFrameworkHiddenIframe" + this.m_id);
  368. if(hiddenIframeElement) {
  369. hiddenIframeElement.style.display = "none";
  370. }
  371. }
  372. catch(e)
  373. {
  374. }
  375. }
  376. function CMenu_enable() {
  377. }
  378. function CMenu_disable() {
  379. }
  380. function CMenu_getState() {
  381. }
  382. function CMenu_clear() {
  383. if(this.m_htmlDivElement != null) {
  384. this.m_htmlDivElement.innerHTML='';
  385. }
  386. this.m_menuItems.splice(0, this.m_menuItems.length);
  387. }
  388. function CMenu_attachEvents() {
  389. for(var i = 0; i < this.m_menuItems.length; i++) {
  390. if(typeof this.m_menuItems[i].attachEvents == "function") {
  391. this.m_menuItems[i].attachEvents();
  392. }
  393. }
  394. }
  395. function CMenu_closeSubMenus(state) {
  396. // Called during a notification...
  397. // make sure we hide any submenus which have been opened.
  398. for(var i = 0; i < this.m_menuItems.length; i++) {
  399. var menuItem = this.m_menuItems[i];
  400. var subject = state.getSubject();
  401. if(menuItem != subject && typeof menuItem.getMenu == "function") {
  402. var oMenu = menuItem.getMenu();
  403. if (oMenu && oMenu.isVisible()) {
  404. oMenu.remove();
  405. }
  406. }
  407. }
  408. }
  409. function CMenu_closeAllMenus(state) {
  410. // Called during a notification...
  411. var current = this;
  412. var highestMenu = null;
  413. while(current) {
  414. if(current instanceof CMenu) {
  415. highestMenu = current;
  416. }
  417. current = current.getParent();
  418. }
  419. if(highestMenu != null) {
  420. highestMenu.remove();
  421. }
  422. }
  423. function CMenu_setStyle(style) {
  424. this.m_style = style;
  425. }
  426. function CMenu_getStyle() {
  427. return this.m_style;
  428. }
  429. function CMenu_setXCoord(x) {
  430. var htmlDiv = this.getHTMLDiv();
  431. if(htmlDiv != null) {
  432. htmlDiv.style.left = x;
  433. }
  434. }
  435. function CMenu_setYCoord(y) {
  436. var htmlDiv = this.getHTMLDiv();
  437. if(htmlDiv != null) {
  438. htmlDiv.style.top = y;
  439. }
  440. }
  441. function CMenu_setZIndex(zIndex) {
  442. var htmlDiv = this.getHTMLDiv();
  443. if(htmlDiv != null) {
  444. htmlDiv.style.zIndex = zIndex;
  445. }
  446. }
  447. // set a callback routine to populate the menu
  448. function CMenu_registerCallback(callback) {
  449. this.m_callback = callback;
  450. }
  451. function CMenu_executeCallback() {
  452. if(typeof this.m_callback == "function")
  453. {
  454. this.m_callback();
  455. }
  456. else if(typeof this.m_callback == "string")
  457. {
  458. eval(this.m_callback);
  459. }
  460. }
  461. function CMenu_getObservers() {
  462. return this.m_observers;
  463. }
  464. function CMenu_onmouseover(evt) {
  465. //get the event in a cross-browser fashion
  466. evt = (evt) ? evt : ((event) ? event : null);
  467. // notify our parent (if one exists) of this event
  468. var oParent = this.getParent();
  469. if(oParent && typeof oParent.onmouseover == 'function') {
  470. oParent.onmouseover(evt);
  471. }
  472. // notify observers of this event
  473. this.getObservers().notify(CMenu_onmouseover);
  474. }
  475. function CMenu_onmouseout(evt) {
  476. //get the event in a cross-browser fashion
  477. evt = (evt) ? evt : ((event) ? event : null);
  478. // notify our parent (if one exists) of this event
  479. var oParent = this.getParent();
  480. if(oParent && typeof oParent.onmouseout == 'function') {
  481. oParent.onmouseout(evt);
  482. }
  483. // notify observers of this event
  484. this.getObservers().notify(CMenu_onmouseout);
  485. }
  486. function CMenu_onmouseup(evt) {
  487. //get the event in a cross-browser fashion
  488. evt = (evt) ? evt : ((event) ? event : null);
  489. // notify our parent (if one exists) of this event
  490. var oParent = this.getParent();
  491. if(oParent && typeof oParent.onmouseup == 'function') {
  492. oParent.onmouseup(evt);
  493. }
  494. // notify observers of this event
  495. this.getObservers().notify(CMenu_onmouseup);
  496. }
  497. function CMenu_onkeypress(evt) {
  498. //get the event in a cross-browser fashion
  499. evt = (evt) ? evt : ((event) ? event : null);
  500. // notify our parent (if one exists) of this event
  501. var oParent = this.getParent();
  502. if(oParent && typeof oParent.onkeypress == 'function') {
  503. oParent.onkeypress(evt);
  504. }
  505. // notify observers of this event
  506. this.getObservers().notify(CMenu_onkeypress);
  507. }
  508. CMenu.prototype.draw = CMenu_draw;
  509. CMenu.prototype.updateCoords = CMenu_updateCoords;
  510. CMenu.prototype.add = CMenu_add;
  511. CMenu.prototype.get = CMenu_get;
  512. CMenu.prototype.getNumItems = CMenu_getNumItems;
  513. CMenu.prototype.hide = CMenu_hide;
  514. CMenu.prototype.hideHiddenIframe = CMenu_hideHiddenIframe;
  515. CMenu.prototype.removeHiddenIframe = CMenu_removeHiddenIframe;
  516. CMenu.prototype.show = CMenu_show;
  517. CMenu.prototype.enable = CMenu_enable;
  518. CMenu.prototype.disable = CMenu_disable;
  519. CMenu.prototype.getState = CMenu_getState;
  520. CMenu.prototype.clear = CMenu_clear;
  521. CMenu.prototype.attachEvents = CMenu_attachEvents;
  522. CMenu.prototype.setParent = CMenu_setParent;
  523. CMenu.prototype.getParent = CMenu_getParent;
  524. CMenu.prototype.getHTMLContainer = CMenu_getHTMLContainer;
  525. CMenu.prototype.setHTMLContainer = CMenu_setHTMLContainer;
  526. CMenu.prototype.getHTMLDiv = CMenu_getHTMLDiv;
  527. CMenu.prototype.create = CMenu_create;
  528. CMenu.prototype.remove = CMenu_remove;
  529. CMenu.prototype.getId = CMenu_getId;
  530. CMenu.prototype.isVisible = CMenu_isVisible;
  531. CMenu.prototype.setStyle = CMenu_setStyle;
  532. CMenu.prototype.getStyle = CMenu_getStyle;
  533. CMenu.prototype.closeSubMenus = CMenu_closeSubMenus;
  534. CMenu.prototype.closeAllMenus = CMenu_closeAllMenus;
  535. CMenu.prototype.setXCoord = CMenu_setXCoord;
  536. CMenu.prototype.setYCoord = CMenu_setYCoord;
  537. CMenu.prototype.setZIndex = CMenu_setZIndex;
  538. CMenu.prototype.update = new Function("return true");
  539. CMenu.prototype.registerCallback = CMenu_registerCallback;
  540. CMenu.prototype.executeCallback = CMenu_executeCallback;
  541. CMenu.prototype.getObservers = CMenu_getObservers;
  542. CMenu.prototype.onmouseover = CMenu_onmouseover;
  543. CMenu.prototype.onmouseout = CMenu_onmouseout;
  544. CMenu.prototype.onmouseup = CMenu_onmouseup;
  545. CMenu.prototype.onkeypress = CMenu_onkeypress;
  546. CMenu.prototype.createHiddenIFrame = CMenu_createHiddenIFrame;
  547. function updateIframeCoords(id, containerId, isNS7)
  548. {
  549. if (g_ownerDocument == null) {
  550. return;
  551. }
  552. var container = g_ownerDocument.getElementById(containerId);
  553. var hiddenIframeElement = g_ownerDocument.getElementById(id);
  554. if (hiddenIframeElement && container) {
  555. if(isNS7 == true) {
  556. hiddenIframeElement.style.left = container.offsetLeft;
  557. hiddenIframeElement.style.top = container.offsetTop;
  558. hiddenIframeElement.style.width = container.offsetWidth;
  559. hiddenIframeElement.style.height = container.offsetHeight;
  560. } else {
  561. hiddenIframeElement.style.pixelLeft = container.offsetLeft;
  562. hiddenIframeElement.style.pixelTop = container.offsetTop;
  563. hiddenIframeElement.style.pixelWidth = container.offsetWidth;
  564. hiddenIframeElement.style.pixelHeight = container.offsetHeight;
  565. }
  566. }
  567. }