From f3f1c7c7421131f46c1c450ab3ee220b971f5251 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 17 Jul 2023 18:21:54 +0200 Subject: [PATCH] wait #6135 @0.75 --- resources/linkeditor/js/linkeditor.form.js | 18 +++++++++++++++--- resources/linkeditor/style/inc/_form.sass | 11 ++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/resources/linkeditor/js/linkeditor.form.js b/resources/linkeditor/js/linkeditor.form.js index 08169686d..fcb4ac3c6 100644 --- a/resources/linkeditor/js/linkeditor.form.js +++ b/resources/linkeditor/js/linkeditor.form.js @@ -9,9 +9,19 @@ LinkeditorForm.prototype = { init: function () { var $this = this; + $(document).on('click', '.freefile-file a.upload', function (e) { + var c = $(this).closest('.freefile-file'); + let f = $(c).find('.freefile-file-input'); + if (e.originalEvent.ctrlKey && $(c).find('.freefile-file-input-directory').length > 0) { + f = $(c).find('.freefile-file-input-directory'); + } + f.get(0).click(); + return false; + }); + + $(document).on('change', '.calculation', function () { var v = $(this).val(); - console.log(v); if (/[0-9\., \-\+\*\/]+/.test(v)) { try { v = eval(v.replace(/,/g, '.')); @@ -50,11 +60,11 @@ LinkeditorForm.prototype = { if ($this._maskChangeEvent) { return; } - $this.saveFormDataInLink(); }); - $(document).on('change', ".freefile-file-input", function () { + + $(document).on('change', ".freefile-file-input, .freefile-file-input-directory", function () { var form = $('#linkupload').clone(); var id = 'linkupload_' + Math.round(Math.random() * 10000000); @@ -207,8 +217,10 @@ LinkeditorForm.prototype = { $(form).attr('id', null); $(form).data('link', link); + $(form).find('.init-tooltip').removeClass('init-tooltip'); this.updateFormData(form); container.append(form); + this.linkeditor.initTooltips(); this.initSelect2(); this.initSpectrum(); diff --git a/resources/linkeditor/style/inc/_form.sass b/resources/linkeditor/style/inc/_form.sass index 205c324d2..c3e71005d 100644 --- a/resources/linkeditor/style/inc/_form.sass +++ b/resources/linkeditor/style/inc/_form.sass @@ -164,11 +164,20 @@ button input[type=file] position: absolute - right: 0px + right: 0 + width: 35px + opacity: 0 + height: 100% + cursor: pointer + + a.upload + position: absolute + right: 0 width: 35px opacity: 0 height: 100% cursor: pointer + z-index: 2 .input-group -- 2.39.5