From: Vincent Vanwaelscappel Date: Fri, 8 Dec 2023 08:36:04 +0000 (+0100) Subject: Revert "wip #6543" X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=029bc4a7fb0d30673f051a838669df7402294aab;p=fluidbook-toolbox.git Revert "wip #6543" This reverts commit f65cc86b9c6747a92c350bdb14c4e1e43592ef11. --- diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index 7f9ccd304..7ebf4d89c 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -30,6 +30,7 @@ window.tippy = tippy; window.Noty = Noty; window.GrahamScan = GrahamScan; + window.key.filter = function (event) { let tagName = (event.target || event.srcElement).tagName; //let field=tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'; @@ -62,7 +63,6 @@ $.ajaxSetup({ function LinkEditor() { this.mobileFirst = FLUIDBOOK_DATA.settings.mobileNavigationType === 'mobilefirst'; this.single = ['mobilefirst', 'portrait'].indexOf(FLUIDBOOK_DATA.settings.mobileNavigationType) >= 0 || FLUIDBOOK_DATA.settings.pages <= 1; - this.rtl = FLUIDBOOK_DATA.id==30547 && !this.single && ['ar', 'he', 'fa', 'ku', 'pa', 'sd', 'ur'].indexOf(FLUIDBOOK_DATA.locale) >= 0; this.pw = FLUIDBOOK_DATA.settings.width; this.ph = FLUIDBOOK_DATA.settings.height; @@ -85,6 +85,7 @@ function LinkEditor() { this.dimensionProperties = ['left', 'top', 'width', 'height']; + this.init(); } @@ -458,9 +459,9 @@ LinkEditor.prototype = { window.location.hash = '#' + this.currentPage; this.clearLinksAndRulers(); - this.loader.loadPage(this.currentPage, this.rtl ? 'right' : 'left'); + this.loader.loadPage(this.currentPage, 'left'); if (!this.single && !isSpecial) { - this.loader.loadPage(this.currentPage + 1, this.rtl ? 'left' : 'right'); + this.loader.loadPage(this.currentPage + 1, 'right'); } $("#linkeditor-page-field input").val(this.currentNumericPage); this.resize.resize(); @@ -559,8 +560,10 @@ LinkEditor.prototype = { getCurrentPage: function () { return this.currentPage; }, + } + $(function () { window.linkeditor = new LinkEditor(); }); diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index e95f51fb0..ca609b6db 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -864,13 +864,11 @@ LinkeditorLinks.prototype = { }, normalizeLinksPage() { - let $this = this; let pw = this.linkeditor.pw; let single = this.linkeditor.single; - let rtl = this.linkeditor.rtl $.each(LINKS, function (uid, link) { link.left = parseFloat(link.left) - if (!rtl) { + if (!single) { if (link.page % 2 === 0 && link.left > pw) { link.page++; link.left -= pw; @@ -879,11 +877,6 @@ LinkeditorLinks.prototype = { link.page--; link.left += pw; } - } else { - if (link.page % 2 === 0) { - link.page++; - link.left += pw; - } } LINKS[uid] = link; }); diff --git a/resources/linkeditor/js/linkeditor.utils.js b/resources/linkeditor/js/linkeditor.utils.js index de2dc5075..05a3efd64 100644 --- a/resources/linkeditor/js/linkeditor.utils.js +++ b/resources/linkeditor/js/linkeditor.utils.js @@ -147,13 +147,9 @@ LinkeditorUtils.prototype = { roundDimension: function (v) { return (Math.round(v * 100000) / 100000); - }, - - intersectRect: function (r1, r2) { + }, intersectRect: function (r1, r2) { return !(r2.left > r1.right || r2.right < r1.left || r2.top > r1.bottom || r2.bottom < r1.top); - }, - - isfocusOnFormItem: function () { + }, isfocusOnFormItem: function () { return $(document.activeElement).is('input[type="text"],input[type="email"],input[type="number"],input[type="tel"],input[type="search"],textarea,select'); },