问题描述
这是我下面的html可编辑div
<div id="editorAbstract"
ng-change="abstractChangeHandler(data.message.data.item.abstract.rawData)" cleanInput ng-blur="OnBlurTitleAbstractChange(this)"
ng-focus="freeIndexing.freeIndexingTermfocus('editorAbstract')"
medium-editor bind-options="{toolbar:true,placeholder:{text: '',hideOnClick: true},disableReturn: true,toolbar: {buttons: ['bold','italic','subscript','superscript','uppercase','lowercase','titlecase','removeFormat'],static:true,align: 'left',sticky:true,updateOnEmptySelection: true},disableExtraSpaces: false,fileDragging: true,spellcheck: false,extensions: {'imageDragging': {}},paste: {forcePlainText: true,cleanPastedHTML: false}}" ng-model="data.message.data.item.abstract.rawData"
ng-keyup="validateAbstractkeyup($event,data.message.data.item.abstract.rawData)" class="contenteditable">
</div>
我有一个名为validateabstractkeyup
的函数,此函数导致了此问题。
$scope.validateAbstractkeyup = function (event,model) {
if (model != null && model != undefined && model != '' &&
model.indexOf('<span style="font-size: 11.25px;">') > -1) {
spanTagEndIndex = (model.indexOf('<span style="font-size: 11.25px;">')) + 34;
closingSpanTagStartIndex = model.indexOf('</span>',spanTagEndIndex);
spanTagInnerText = model.substring(spanTagEndIndex,closingSpanTagStartIndex);
stringforreplace = '<span style="font-size: 11.25px;">' + spanTagInnerText + '</span>'
result = model.replace(stringforreplace,spanTagInnerText);
$scope.data.message.data.item.abstract.rawData = result;
}
$scope.data.message.data.item.abstract.rawData
(此键绑定到ng-model
,用于可编辑的div)可能正在刷新。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)