fix links click in wysiwyg
parent
5c1e42c894
commit
078972862d
|
@ -492,12 +492,6 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
if 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) ->
|
||||
$scope.onUploadFile({files: event.dataTransfer.files, cb: uploadEnd})
|
||||
|
||||
|
@ -524,6 +518,16 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
wysiwygCodeHightlighterService.addHightlighter(mediumInstance.elements[0])
|
||||
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) ->
|
||||
$scope.$applyAsync () ->
|
||||
$scope.codeEditorVisible = true
|
||||
|
@ -561,6 +565,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
|
||||
$scope.$on "$destroy", () ->
|
||||
if mediumInstance
|
||||
$(editorMedium[0]).off() if editorMedium.length
|
||||
mediumInstance.destroy()
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue