update rte controllers to add anchors array to overlay model - anchors are parsed from the current editor properties
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user