Now inserting mediaId in the link picker and setting the isMedia flag so that you can get mediaId's from the linkPicker dialogservice
This commit is contained in:
@@ -181,6 +181,7 @@ tinymce.PluginManager.add('umbracolink', function(editor) {
|
||||
currentTarget: currentTarget,
|
||||
callback: function (data) {
|
||||
if (data) {
|
||||
console.log(data);
|
||||
var href = data.url;
|
||||
|
||||
function insertLink() {
|
||||
@@ -208,8 +209,8 @@ tinymce.PluginManager.add('umbracolink', function(editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if we have an id, it must be a locallink:id
|
||||
if(data.id){
|
||||
//if we have an id, it must be a locallink:id, aslong as the isMedia flag is not set
|
||||
if(data.id && (angular.isUndefined(data.isMedia) || !data.isMedia)){
|
||||
href = "/{localLink:" + data.id + "}";
|
||||
insertLink();
|
||||
return;
|
||||
|
||||
@@ -28,7 +28,8 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
|
||||
|
||||
$scope.switchToMediaPicker = function(){
|
||||
dialogService.mediaPicker({callback: function(media){
|
||||
$scope.target.id = undefined;
|
||||
$scope.target.id = media.id;
|
||||
$scope.target.isMedia = true;
|
||||
$scope.target.name = media.name;
|
||||
$scope.target.url = mediaHelper.resolveFile(media);
|
||||
}});
|
||||
|
||||
Reference in New Issue
Block a user