full-screen.src.js 958 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * (c) 2009-2019 Sebastian Bochann
  3. *
  4. * Full screen for Highcharts
  5. *
  6. * License: www.highcharts.com/license
  7. */
  8. 'use strict';
  9. import H from '../parts/Globals.js';
  10. H.FullScreen = function (container) {
  11. this.init(container.parentNode); // main div of the chart
  12. };
  13. /**
  14. * The module allows user to enable full screen mode in StockTools.
  15. * Based on default solutions in browsers.
  16. *
  17. */
  18. H.FullScreen.prototype = {
  19. /**
  20. * Init function
  21. *
  22. * @param {HTMLDOMElement} - chart div
  23. *
  24. */
  25. init: function (container) {
  26. if (container.requestFullscreen) {
  27. container.requestFullscreen();
  28. } else if (container.mozRequestFullScreen) {
  29. container.mozRequestFullScreen();
  30. } else if (container.webkitRequestFullscreen) {
  31. container.webkitRequestFullscreen();
  32. } else if (container.msRequestFullscreen) {
  33. container.msRequestFullscreen();
  34. }
  35. }
  36. };