-
Notifications
You must be signed in to change notification settings - Fork 128
[PowerPoint] Add binding-to-shapes snippet #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
davidchesnut
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a few suggestions.
| document | ||
| .getElementById("insert-image-and-create-binding") | ||
| .addEventListener("click", () => tryCatch(insertImageWithBinding)); | ||
| document.getElementById("replace-binding1").addEventListener("click", () => tryCatch(replaceImageinBinding1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get rid of the 1..3 functions by using this syntax to pass the values instead:
document.getElementById("replace-binding1").addEventListener("click", () => tryCatch(() => {replaceBinding(1)}));
document.getElementById("replace-binding2").addEventListener("click", () => tryCatch(() => { replaceBinding(2) }));
document.getElementById("replace-binding3").addEventListener("click", () => tryCatch(() => { replaceBinding(3) }));| }); | ||
| } | ||
|
|
||
| function replaceImageinBinding1() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can drop all 3 of these functions if you use the updated trycatch blocks above.
Co-authored-by: David Chesnut <[email protected]>
davidchesnut
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
No description provided.