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:
Jackie Nagel
2014-04-15 18:07:40 +02:00
parent 5697809ce9
commit e4f63c0576
2 changed files with 5 additions and 3 deletions

View File

@@ -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;

View File

@@ -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);
}});