fix links click in wysiwyg

stable
Juanfran 2017-03-24 13:54:24 +01:00
parent 5c1e42c894
commit 078972862d
1 changed files with 12 additions and 7 deletions

View File

@ -492,12 +492,6 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
if e.target.href if e.target.href
window.open(e.target.href) window.open(e.target.href)
mediumInstance.subscribe 'focus', (event) ->
$scope.$applyAsync () ->
if !$scope.editMode
setEditMode(true)
refreshCodeBlocks(mediumInstance)
mediumInstance.subscribe 'editableDrop', (event) -> mediumInstance.subscribe 'editableDrop', (event) ->
$scope.onUploadFile({files: event.dataTransfer.files, cb: uploadEnd}) $scope.onUploadFile({files: event.dataTransfer.files, cb: uploadEnd})
@ -524,6 +518,16 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
wysiwygCodeHightlighterService.addHightlighter(mediumInstance.elements[0]) wysiwygCodeHightlighterService.addHightlighter(mediumInstance.elements[0])
refreshCodeBlocks(mediumInstance) refreshCodeBlocks(mediumInstance)
$(editorMedium[0]).on 'mousedown', (e) ->
if e.target.href
e.preventDefault()
e.stopPropagation()
else
$scope.$applyAsync () ->
if !$scope.editMode
setEditMode(true)
refreshCodeBlocks(mediumInstance)
$(editorMedium[0]).on 'dblclick', 'pre', (e) -> $(editorMedium[0]).on 'dblclick', 'pre', (e) ->
$scope.$applyAsync () -> $scope.$applyAsync () ->
$scope.codeEditorVisible = true $scope.codeEditorVisible = true
@ -561,6 +565,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
$scope.$on "$destroy", () -> $scope.$on "$destroy", () ->
if mediumInstance if mediumInstance
$(editorMedium[0]).off() if editorMedium.length
mediumInstance.destroy() mediumInstance.destroy()
return { return {