简体   繁体   English

禁用拖放

[英]Disable drag and drop

Does anyone know how to disable the CKEditor Drag and Drop? 有谁知道如何禁用CKEditor拖放功能? I realize some code must be added to the config.js file and have tried the suggested methods found on the internet but nothing seems to work. 我意识到必须将某些代码添加到config.js文件中,并尝试了在Internet上找到的建议方法,但似乎无济于事。 Any help would be appreciated. 任何帮助,将不胜感激。 Thanks 谢谢

Please try putting below code into HTML page directly (where CKEditor is used) and then try to drag&drop something inside the editor. 请尝试将下面的代码直接放入HTML页面(使用CKEditor的地方),然后尝试在编辑器中拖放某些内容。 The code will work in IE9+ and modern browsers. 该代码将在IE9 +和现代浏览器中运行。

var editor = CKEDITOR.replace( 'editor1', {
 // editor configuration can be put here...
});
editor.on( 'pluginsLoaded', function( evt ) {
    editor.on( 'contentDom', function( e ) {
        e.editor.editable().attachListener( editor.document, 'drop', function( event ) {
            event.data.preventDefault();
        } );
    } );
});

You know what - this forum is the most user unfriendly software and the most user moderation unfriendly of any forum I have visited - seems like the moderators here just want to sit around and complain and try to be traffic cops. 您知道吗-这个论坛是我访问过的任何论坛中最不友好的软件,也是最不友好的用户审核-似乎这里的主持人只是想围坐在那里抱怨并试图成为交通警察。 BTW I own a forum with many thousands of members and nobody is treated there like I am here so please delete me as a user and I won't return! 顺便说一句,我拥有一个拥有成千上万会员的论坛,并且在这里没有人像我在这里那样受到对待,所以请删除我作为用户的身份,我不会回来!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM