We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2939c56 commit b0c5a3aCopy full SHA for b0c5a3a
js/demo/demo.js
@@ -123,16 +123,19 @@ $(function () {
123
* @param {boolean} [keepMetaData] Keep meta data if true
124
*/
125
function updateResults(img, data, keepMetaData) {
126
+ var isCanvas = window.HTMLCanvasElement && img instanceof HTMLCanvasElement
127
if (!keepMetaData) {
128
removeMetaData()
129
if (data) {
- if (img.getContext) {
130
- actionsNode.show()
131
- }
132
displayMetaData(data)
133
}
+ if (isCanvas) {
+ actionsNode.show()
134
+ } else {
135
+ actionsNode.hide()
136
+ }
137
- if (!(img.src || img instanceof HTMLCanvasElement)) {
138
+ if (!(isCanvas || img.src)) {
139
resultNode
140
.children()
141
.replaceWith($('<span>Loading image file failed</span>'))
0 commit comments