[Enhancement] Hide export buttons during export

Buttons temporarily hide until export completes.
This commit is contained in:
David Hudson
2016-09-02 20:41:38 +09:00
parent 3736f84c12
commit de85f79ab6
3 changed files with 28 additions and 7 deletions

View File

@ -71,23 +71,32 @@ define(
});
}
ExportImageService.prototype.exportPDF = function (element, filename) {
ExportImageService.prototype.exportPDF = function (element, filename, callback) {
callback = typeof callback === "function" ? callback : function () {};
renderElement(element, function (img) {
var pdf = new jsPDF("l", "px", [element.offsetHeight, element.offsetWidth]);
pdf.addImage(img, "JPEG", 0, 0, element.offsetWidth, element.offsetHeight);
pdf.save(filename);
callback();
}, "jpeg");
};
ExportImageService.prototype.exportJPG = function (element, filename) {
ExportImageService.prototype.exportJPG = function (element, filename, callback) {
callback = typeof callback === "function" ? callback : function () {};
renderElement(element, function (img) {
saveAs(img, filename);
callback();
}, "blob");
};
ExportImageService.prototype.exportPNG = function (element, filename) {
ExportImageService.prototype.exportPNG = function (element, filename, callback) {
callback = typeof callback === "function" ? callback : function () {};
renderElement(element, function (img) {
saveAs(img, filename);
callback();
}, "blob");
};