update rte controllers to add anchors array to overlay model - anchors are parsed from the current editor properties

This commit is contained in:
Nathan Woulfe
2018-06-17 14:39:45 +10:00
parent f3375c01d8
commit 1cbb456dcd
2 changed files with 6 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
(function() {
"use strict";
function GridRichTextEditorController($scope, tinyMceService, macroService) {
function GridRichTextEditorController($scope, tinyMceService, macroService, editorState) {
var vm = this;
@@ -11,9 +11,11 @@
vm.openEmbed = openEmbed;
function openLinkPicker(editor, currentTarget, anchorElement) {
vm.linkPickerOverlay = {
view: "linkpicker",
currentTarget: currentTarget,
anchors: tinyMceService.getAnchorNames(JSON.stringify(editorState.current.properties)),
show: true,
submit: function(model) {
tinyMceService.insertLinkInEditor(editor, model.target, anchorElement);

View File

@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.RTEController",
function ($rootScope, $scope, $q, $locale, dialogService, $log, imageHelper, assetsService, $timeout, tinyMceService, angularHelper, stylesheetResource, macroService) {
function ($rootScope, $scope, $q, $locale, dialogService, $log, imageHelper, assetsService, $timeout, tinyMceService, angularHelper, stylesheetResource, macroService, editorState) {
$scope.isLoading = true;
@@ -273,11 +273,12 @@ angular.module("umbraco")
syncContent(editor);
});
tinyMceService.createLinkPicker(editor, $scope, function(currentTarget, anchorElement) {
$scope.linkPickerOverlay = {
view: "linkpicker",
currentTarget: currentTarget,
anchors: tinyMceService.getAnchorNames(JSON.stringify(editorState.current.properties)),
show: true,
submit: function(model) {
tinyMceService.insertLinkInEditor(editor, model.target, anchorElement);