rightSideBar.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*##############################################################################
  2. # Copyright (C) 2011 HPCC Systems.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ############################################################################## */
  17. var prevFrameColumns = null;
  18. function onLoadNav()
  19. {
  20. if (app_name)
  21. {
  22. top.frames['header'].document.getElementById('AppName').innerHTML = '<p align="center"><b><font size="5">' + app_name + '</font></b></p>';
  23. }
  24. }
  25. function getLowerFrameset()
  26. {
  27. var frameset = null;
  28. if (window.top != window.self)
  29. {
  30. var frame = top.document.getElementsByName('nav')[0];
  31. var frameset = frame.parentElement;
  32. if (!frameset)
  33. frameset = frame.parentNode;//for Firefox
  34. }
  35. return frameset;
  36. }
  37. function onToggleTreeView(button) {
  38. var frameset = getLowerFrameset();
  39. if (frameset)
  40. {
  41. var content = document.getElementById('pageBody');
  42. var btn = document.getElementById('espnavcollapse');
  43. var show = prevFrameColumns != null; //content.style.display == 'none';
  44. if (show)
  45. {
  46. frameset.cols = prevFrameColumns;
  47. content.style.display = 'block';
  48. content.style.visibility = 'visible'
  49. btn.className = 'espnavcollapse';
  50. button.title = 'Click to hide left frame';
  51. prevFrameColumns = null;
  52. }
  53. else
  54. {
  55. prevFrameColumns = frameset.cols;
  56. btn.className = 'espnavexpand';
  57. frameset.cols = '15,*';
  58. content.style.display = 'none';
  59. content.style.visibility = 'hidden'
  60. button.title = 'Click to show left frame';
  61. }
  62. }
  63. }
  64. function leftFrameResized() {
  65. return;
  66. if (prevFrameColumns)
  67. {
  68. var frameset = getLowerFrameset();
  69. var w = document.body.clientWidth;
  70. if (w > 10 && frameset)
  71. {
  72. prevFrameColumns = frameset.cols;
  73. var div = document.getElementById('espnavcollapse');
  74. onToggleTreeView(div);
  75. }
  76. }
  77. }