Gets the link and media pickers working in the grid in the rte with ignore start nodes
This commit is contained in:
@@ -4,7 +4,9 @@ angular.module("umbraco.directives")
|
||||
scope: {
|
||||
uniqueId: '=',
|
||||
value: '=',
|
||||
configuration: "="
|
||||
configuration: "=", //this is the RTE configuration
|
||||
datatypeId: '@',
|
||||
ignoreUserStartNodes: '@'
|
||||
},
|
||||
templateUrl: 'views/components/grid/grid-rte.html',
|
||||
replace: true,
|
||||
@@ -35,6 +37,14 @@ angular.module("umbraco.directives")
|
||||
editorConfig.maxImageSize = tinyMceService.defaultPrevalues().maxImageSize;
|
||||
}
|
||||
|
||||
//ensure the grid's global config is being passed up to the RTE, these 2 properties need to be in this format
|
||||
//since below we are just passing up `scope` as the actual model and for 2 way binding to work with `value` that
|
||||
//is the way it needs to be unless we start adding watchers. We'll just go with this for now but it's super ugly.
|
||||
scope.config = {
|
||||
ignoreUserStartNodes: scope.ignoreUserStartNodes === "true"
|
||||
}
|
||||
scope.dataTypeId = scope.datatypeId; //Yes - this casing is rediculous, but it's because the var starts with `data` so it can't be `data-type-id` :/
|
||||
|
||||
//stores a reference to the editor
|
||||
var tinyMceEditor = null;
|
||||
|
||||
|
||||
@@ -1155,6 +1155,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
|
||||
var linkPicker = {
|
||||
currentTarget: currentTarget,
|
||||
dataTypeId: args.model.dataTypeId,
|
||||
ignoreUserStartNodes: args.model.config.ignoreUserStartNodes,
|
||||
anchors: getCurrentAnchorNames(),
|
||||
submit: function (model) {
|
||||
self.insertLinkInEditor(args.editor, model.target, anchorElement);
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<grid-rte
|
||||
configuration="model.config.rte"
|
||||
value="control.value"
|
||||
unique-id="control.$uniqueId">
|
||||
unique-id="control.$uniqueId"
|
||||
datatype-id="{{model.dataTypeId}}"
|
||||
ignore-user-start-nodes="{{model.config.ignoreUserStartNodes}}">
|
||||
</grid-rte>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user