]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5916 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 07:10:35 +0000 (09:10 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 07:10:35 +0000 (09:10 +0200)
resources/linkeditor/js/linkeditor.layers.js
resources/linkeditor/js/linkeditor.links.js

index 1511e7a53e393113c30d3ab097cad18fbe9fdc00..d3aa4926488f8e98d33956c8c7afc6976e9523ae 100644 (file)
@@ -42,8 +42,9 @@ LinkeditorLayers.prototype = {
                 dest = '<em>' + TRANSLATIONS.empty + '</em>';
             }
             var l = '<label class="layer" fb-type="' + type + '"><input name="' + $(this).attr('fb-uid') + '" type="checkbox"> ' + dest + '</label>';
+            let level = Math.floor(parseInt($(this).attr('fb-calc-depth')) / 10);
             layers.push({
-                level: Math.round(parseInt($(this).attr('fb-calc-depth')) / 10),
+                level: level,
                 zindex: parseInt($(this).attr('fb-calc-zindex')),
                 html: l
             });
index a1c3cb2725fec6258b9e3d1543f8637335d1a34a..30224fc96eb51d65464ad03a66fb4d42779ef90d 100644 (file)
@@ -1059,7 +1059,7 @@ LinkeditorLinks.prototype = {
         var settings = [];
         $.each(conf, function (k, v) {
             let val = $(link).attr('fb-' + k);
-            if (k === 'alternative') {
+            if (k === 'alternative' || k==='to') {
                 let e = val.split('.');
                 let ext = e.pop().toLowerCase();
                 val = (['png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'svg'].indexOf(ext) >= 0) ? 'file.jpg' : 'file.zip';