MCPcopy Index your code
hub / github.com/dropzone/dropzone / fallback

Function fallback

src/options.js:415–444  ·  view source on GitHub ↗

* Gets called when the browser is not supported. * The default implementation shows the fallback input field and adds * a text.

()

Source from the content-addressed store, hash-verified

413 * a text.
414 */
415 fallback() {
416 // This code should pass in IE7... :(
417 let messageElement;
418 this.element.className = `${this.element.className} dz-browser-not-supported`;
419
420 for (let child of this.element.getElementsByTagName("div")) {
421 if (/(^| )dz-message($| )/.test(child.className)) {
422 messageElement = child;
423 child.className = "dz-message"; // Removes the 'dz-default' class
424 break;
425 }
426 }
427 if (!messageElement) {
428 messageElement = Dropzone.createElement(
429 '<div class="dz-message"><span></span></div>'
430 );
431 this.element.appendChild(messageElement);
432 }
433
434 let span = messageElement.getElementsByTagName("span")[0];
435 if (span) {
436 if (span.textContent != null) {
437 span.textContent = this.options.dictFallbackMessage;
438 } else if (span.innerText != null) {
439 span.innerText = this.options.dictFallbackMessage;
440 }
441 }
442
443 return this.element.appendChild(this.getFallbackForm());
444 },
445
446 /**
447 * Gets called to calculate the thumbnail dimensions.

Callers

nothing calls this directly

Calls 1

getFallbackFormMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…