From ecaa853799c9275683897fe82b2fb823b6b5f089 Mon Sep 17 00:00:00 2001 From: Nathan Woulfe Date: Sun, 17 Jun 2018 20:07:14 +1000 Subject: [PATCH] tidy up get/set for anchor when opening overlay --- .../src/common/services/tinymce.service.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index bc1dd987fd..860a25b09d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -689,7 +689,7 @@ function tinyMceService($log, imageHelper, $http, $timeout, macroResource, macro }; // drop the lead char from the anchor text, if it has a value - var anchorVal = anchor.data("anchor"); + var anchorVal = anchor[0].dataset.anchor; if (anchorVal) { currentTarget.anchor = anchorVal.substring(1); } @@ -699,8 +699,7 @@ function tinyMceService($log, imageHelper, $http, $timeout, macroResource, macro if (currentTarget.url.indexOf("localLink:") > 0) { // if the current link has an anchor, it needs to be considered when getting the udi/id // if an anchor exists, reduce the substring max by its length plus two to offset the removed prefix and trailing curly brace - var linkId = currentTarget.url.substring(currentTarget.url.indexOf(":") + 1, - currentTarget.url.length - (currentTarget.anchor ? currentTarget.anchor.length + 2 : 1)); + var linkId = currentTarget.url.substring(currentTarget.url.indexOf(":") + 1, currentTarget.url.lastIndexOf("}")); //we need to check if this is an INT or a UDI var parsedIntId = parseInt(linkId, 10);