diff --git a/options/options.js b/options/options.js index 4e39775..c56e2e0 100644 --- a/options/options.js +++ b/options/options.js @@ -1192,6 +1192,21 @@ $(function () { addUploadedImageToSelectors(data && data.file); } }); + // row 139: second upload widget in the "Top of the page" tab (under the logos + // row) — own input/progress ids, same shared upload form; uploads land in the + // same image selectors via addUploadedImageToSelectors + new BindUpload({ + form: '#upload_frontend', + input: '#upload_image_frontend_top', + progress: '#upload_progress_frontend_top', + onBeforeSend: function () { + $('.simple-template-edit-loading').css('display', 'block'); + }, + onSuccess: function (inputId, data) { + $('.simple-template-edit-loading').css('display', 'none'); + addUploadedImageToSelectors(data && data.file); + } + }); // Adds a freshly uploaded image to the theme options image selectors so it becomes // selectable immediately, without a full page reload. Falls back to a reload if the diff --git a/options/options.twig b/options/options.twig index 65f3bdb..4f08b30 100644 --- a/options/options.twig +++ b/options/options.twig @@ -43,7 +43,7 @@ heuristically cached copy (the file has only Last-Modified/ETag, no Cache-Control). Re-register it with a version token: bump OPTIONS_JS_TOKEN below whenever options/options.js changes, so every browser fetches the new file once. #} -{% set OPTIONS_JS_TOKEN = '20261126.15' %} +{% set OPTIONS_JS_TOKEN = '20261126.16' %} {{ unregisterScriptFile(optionsPath ~ '/options.js') }} {{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }} @@ -481,6 +481,40 @@ {% endfor %}