禁用元素属性的排序 [英] Disable sorting of element attributes

查看:183
本文介绍了禁用元素属性的排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法禁用对元素属性的排序,这样,当allowedContent设置为true时,checkDirty()将正常工作?

Is there a way to disable the sorting of element attributes so that checkDirty() will work correctly when allowedContent is set to true?

属性排序示例这里

<div zattribute='z' attribute='a'>simple</div

变更为

<div attribute="a" zattribute="z">simple</div>

导致checkDirty()调用始终返回true,即使用户实际上没有更改任何内容ckeditor用户界面。

causing the checkDirty() call to always return true even though the user didn't actually change anything within the ckeditor user interface.

推荐答案

这是我最终使用基于Reinmar的建议。

This is what I ended up using based on Reinmar's suggestions.

jsfiddle

var isdirty = function(ckeditor) {
        return ckeditor.initialdata !== ckeditor.getData();

    };
CKEDITOR.on('instanceReady', function (event) {
        event.editor.initialdata = event.editor.getData();
    });

这篇关于禁用元素属性的排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆