From 3d6fe6efe8c8bbdf28964880356c0ae3176af02b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 16 Dec 2016 14:58:22 +1300 Subject: [PATCH] Move Clara download button when displaying on tablet --- scripts/system/html/js/marketplacesInject.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 114742f086..8dad85a66d 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -123,6 +123,18 @@ buttons.children(":nth-child(2), .btn-group , .embed-button").each(function () { this.remove(); }); } + // Move the "Download to High Fidelity" button to be more visible on tablet. + if ($("#hifi-download-container").length === 0 && window.innerWidth < 700) { + // Moving the button stops the Clara.io download from starting so instead, make a visual copy in the right place + // and wire its click event to click the original button. + var downloadContainer = $('
'); + $(".top-title .col-sm-4").append(downloadContainer); + var downloadButton = $("a[data-extension=\'fbx\']").clone(); + downloadButton[0].addEventListener("click", function () { downloadFBX.click(); }); + downloadContainer.append(downloadButton); + downloadFBX.style.visibility = "hidden"; + } + // Automatic download to High Fidelity. var downloadTimer; function startAutoDownload(event) { @@ -176,6 +188,13 @@ '' ); + // Move "Download to High Fidelity" button. + $("head").append( + '' + ); + // Update code injected per page displayed. var updateClaraCodeInterval = undefined; updateClaraCode();