Screenshot handlers

This commit is contained in:
Richard Lewis 2017-12-15 21:36:02 +00:00
parent 954c6eecd6
commit e63f5696a6
2 changed files with 22 additions and 14 deletions

View file

@ -274,15 +274,14 @@ export default React.createClass({
_onSnapshotClick(e) {
console.warn("Requesting widget snapshot");
this.widgetMessaging.getScreenshot();
// const iframe = this.refs.appFrame;
// domtoimage.toPng(iframe).then(function(dataUrl) {
// console.log("Image data URL:", dataUrl);
// dis.dispatch({
// action: 'picture_snapshot',
// file: dataURLtoBlob(dataUrl),
// }, true);
// });
this.widgetMessaging.getScreenshot().then((screenshot) => {
dis.dispatch({
action: 'picture_snapshot',
file: screenshot,
}, true);
}).catch((err) => {
console.error("Failed to get screenshot", err);
});
},
/* If user has permission to modify widgets, delete the widget,