拖放图像无法在tinymce文本编辑器中工作

时间:2015-08-18 07:11:45

标签: javascript jquery tinymce tinymce-4

我在ASP.NET C#Project中使用http://www.tinymce.com插件。 我在aspx页面中添加了以下代码

 <script src="../Scripts/TinyEditor/tinymce.min.js"></script>
<script type="text/javascript">
    tinymce.init({
        selector: "textarea",
        theme: "modern",
        plugins: [
            "advlist autolink lists link image charmap print preview hr anchor pagebreak",
            "searchreplace wordcount visualblocks visualchars code fullscreen",
            "insertdatetime media nonbreaking save table contextmenu directionality",
            "emoticons template paste textcolor colorpicker textpattern"
        ],
        toolbar1: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
        toolbar2: "print preview media | forecolor backcolor emoticons",
        image_advtab: true,
        templates: [
            { title: 'Test template 1', content: 'Test 1' },
            { title: 'Test template 2', content: 'Test 2' }
        ]
    });
</script>

现在,每当我们拖动图像然后将其放入文本区域时,它就不会插入到textarea中...请帮帮我!!!

1 个答案:

答案 0 :(得分:5)

如果您想启用图片拖放功能drop功能你必须使用下面的代码明确地执行它。

tinymce.init({
    ...
    paste_data_images: true
});