ie editor bugs

stable
Juanfran 2017-02-20 14:47:13 +01:00
parent 24722c4c7e
commit e6b2a91ed3
5 changed files with 13 additions and 14 deletions

View File

@ -378,11 +378,7 @@ Svg = () ->
<svg class="{{ 'icon ' + svgIcon }}"> <svg class="{{ 'icon ' + svgIcon }}">
<use xlink:href="" ng-attr-xlink:href="{{ '#' + svgIcon }}"> <use xlink:href="" ng-attr-xlink:href="{{ '#' + svgIcon }}">
<title ng-if="svgTitle">{{svgTitle}}</title> <title ng-if="svgTitle">{{svgTitle}}</title>
<title <title ng-if="svgTitleTranslate">{{svgTitleTranslate | translate: svgTitleTranslateValues}}</title>
ng-if="svgTitleTranslate"
translate="{{svgTitleTranslate}}"
translate-values="{{svgTitleTranslateValues}}"
></title>
</use> </use>
</svg> </svg>
""" """

View File

@ -148,6 +148,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
$scope.required = !!$attrs.$attr.required $scope.required = !!$attrs.$attr.required
$scope.editMode = isEditOnly || false $scope.editMode = isEditOnly || false
$scope.mode = $storage.get('editor-mode', 'html') $scope.mode = $storage.get('editor-mode', 'html')
$scope.markdown = ''
wysiwygService.loadEmojis() wysiwygService.loadEmojis()
@ -166,7 +167,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
$scope.mode = mode $scope.mode = mode
mediumInstance.trigger('editableBlur', {}, editorMedium[0]) mediumInstance.trigger('editableBlur', {}, editorMedium[0])
$scope.save = () -> $scope.save = (e) ->
e.preventDefault() if e
if $scope.mode == 'html' if $scope.mode == 'html'
updateMarkdownWithCurrentHtml() updateMarkdownWithCurrentHtml()
@ -179,7 +182,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
return return
$scope.cancel = () -> $scope.cancel = (e) ->
e.preventDefault() if e
if !isEditOnly if !isEditOnly
$scope.editMode = false $scope.editMode = false

View File

@ -78,7 +78,6 @@
} }
p { p {
margin-bottom: 1rem; margin-bottom: 1rem;
max-width: 80rem;
word-wrap: break-word; word-wrap: break-word;
} }
.codehilite { .codehilite {

View File

@ -66,8 +66,7 @@ class WysiwygService
return text return text
removeTrailingListBr: (text) -> removeTrailingListBr: (text) ->
regex = new RegExp(/<li>(.*?)<br><\/li>/, 'g') return text.replace(/<li>(.*?)<br><\/li>/g, '<li>$1</li>')
return text.replace(regex, '<li>$1</li>')
getMarkdown: (html) -> getMarkdown: (html) ->
# https://github.com/yabwe/medium-editor/issues/543 # https://github.com/yabwe/medium-editor/issues/543

View File

@ -8,8 +8,8 @@
) )
textarea.markdown.e2e-markdown-textarea( textarea.markdown.e2e-markdown-textarea(
placeholder="{{placeholder}}" ng-attr-placeholder="{{placeholder}}"
ng-change="changeMarkdown()" ng-change="changeMarkdown(markdown)"
ng-model="markdown" ng-model="markdown"
ng-show="mode == 'markdown' && editMode" ng-show="mode == 'markdown' && editMode"
) )
@ -47,12 +47,12 @@
ng-class="{disabled: required && !markdown.length}" ng-class="{disabled: required && !markdown.length}"
tg-loading="saving" tg-loading="saving"
href="#", href="#",
ng-click="save()" ng-click="save($event)"
) )
tg-svg(svg-icon="icon-save") tg-svg(svg-icon="icon-save")
a.e2e-cancel-editor( a.e2e-cancel-editor(
href="#", href="#",
ng-click="cancel()" ng-click="cancel($event)"
title="{{ 'COMMON.CANCEL' | translate }}" title="{{ 'COMMON.CANCEL' | translate }}"
) )
tg-svg(svg-icon="icon-close") tg-svg(svg-icon="icon-close")