From b51ffcada6c92713e3ee7efebbd116b7b6561a7c Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sat, 10 Sep 2016 01:59:07 +0900 Subject: [PATCH] [Formatting] Add inline JSDoc Issue #1164 --- .../plot/src/services/ExportImageService.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/platform/features/plot/src/services/ExportImageService.js b/platform/features/plot/src/services/ExportImageService.js index 21b56e2bda..093360dcce 100644 --- a/platform/features/plot/src/services/ExportImageService.js +++ b/platform/features/plot/src/services/ExportImageService.js @@ -125,6 +125,12 @@ define( } } + /** + * Takes a screenshot of a DOM node and exports to PDF. + * @param {node} element to be exported + * @param {string} filename the exported image + * @returns {promise} + */ ExportImageService.prototype.exportPDF = function (element, filename) { return renderElement(element, "jpeg").then(function (img) { var pdf = new self.jsPDF("l", "px", [element.offsetHeight, element.offsetWidth]); @@ -133,12 +139,24 @@ define( }); }; + /** + * Takes a screenshot of a DOM node and exports to JPG. + * @param {node} element to be exported + * @param {string} filename the exported image + * @returns {promise} + */ ExportImageService.prototype.exportJPG = function (element, filename) { return renderElement(element, "blob").then(function (img) { self.saveAs(img, filename); }); }; + /** + * Takes a screenshot of a DOM node and exports to PNG. + * @param {node} element to be exported + * @param {string} filename the exported image + * @returns {promise} + */ ExportImageService.prototype.exportPNG = function (element, filename) { return renderElement(element, "blob").then(function (img) { self.saveAs(img, filename);