ie editor bugs
parent
24722c4c7e
commit
e6b2a91ed3
|
@ -378,11 +378,7 @@ Svg = () ->
|
|||
<svg class="{{ 'icon ' + svgIcon }}">
|
||||
<use xlink:href="" ng-attr-xlink:href="{{ '#' + svgIcon }}">
|
||||
<title ng-if="svgTitle">{{svgTitle}}</title>
|
||||
<title
|
||||
ng-if="svgTitleTranslate"
|
||||
translate="{{svgTitleTranslate}}"
|
||||
translate-values="{{svgTitleTranslateValues}}"
|
||||
></title>
|
||||
<title ng-if="svgTitleTranslate">{{svgTitleTranslate | translate: svgTitleTranslateValues}}</title>
|
||||
</use>
|
||||
</svg>
|
||||
"""
|
||||
|
|
|
@ -148,6 +148,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
$scope.required = !!$attrs.$attr.required
|
||||
$scope.editMode = isEditOnly || false
|
||||
$scope.mode = $storage.get('editor-mode', 'html')
|
||||
$scope.markdown = ''
|
||||
|
||||
wysiwygService.loadEmojis()
|
||||
|
||||
|
@ -166,7 +167,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
$scope.mode = mode
|
||||
mediumInstance.trigger('editableBlur', {}, editorMedium[0])
|
||||
|
||||
$scope.save = () ->
|
||||
$scope.save = (e) ->
|
||||
e.preventDefault() if e
|
||||
|
||||
if $scope.mode == 'html'
|
||||
updateMarkdownWithCurrentHtml()
|
||||
|
||||
|
@ -179,7 +182,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
|
||||
return
|
||||
|
||||
$scope.cancel = () ->
|
||||
$scope.cancel = (e) ->
|
||||
e.preventDefault() if e
|
||||
|
||||
if !isEditOnly
|
||||
$scope.editMode = false
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@
|
|||
}
|
||||
p {
|
||||
margin-bottom: 1rem;
|
||||
max-width: 80rem;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.codehilite {
|
||||
|
|
|
@ -66,8 +66,7 @@ class WysiwygService
|
|||
return text
|
||||
|
||||
removeTrailingListBr: (text) ->
|
||||
regex = new RegExp(/<li>(.*?)<br><\/li>/, 'g')
|
||||
return text.replace(regex, '<li>$1</li>')
|
||||
return text.replace(/<li>(.*?)<br><\/li>/g, '<li>$1</li>')
|
||||
|
||||
getMarkdown: (html) ->
|
||||
# https://github.com/yabwe/medium-editor/issues/543
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
)
|
||||
|
||||
textarea.markdown.e2e-markdown-textarea(
|
||||
placeholder="{{placeholder}}"
|
||||
ng-change="changeMarkdown()"
|
||||
ng-attr-placeholder="{{placeholder}}"
|
||||
ng-change="changeMarkdown(markdown)"
|
||||
ng-model="markdown"
|
||||
ng-show="mode == 'markdown' && editMode"
|
||||
)
|
||||
|
@ -47,12 +47,12 @@
|
|||
ng-class="{disabled: required && !markdown.length}"
|
||||
tg-loading="saving"
|
||||
href="#",
|
||||
ng-click="save()"
|
||||
ng-click="save($event)"
|
||||
)
|
||||
tg-svg(svg-icon="icon-save")
|
||||
a.e2e-cancel-editor(
|
||||
href="#",
|
||||
ng-click="cancel()"
|
||||
ng-click="cancel($event)"
|
||||
title="{{ 'COMMON.CANCEL' | translate }}"
|
||||
)
|
||||
tg-svg(svg-icon="icon-close")
|
||||
|
|
Loading…
Reference in New Issue