2016-06-20 5 views
2

Я создаю редактор richtext с помощью dojo. Я применил функции extraPlugin для этого богатого текстового редактора. Он работает правильно, но параметры панели инструментов не обернуты.Редактор Dojo Richtext Панель инструментов не правильная настройка

enter image description here

Как вы можете видеть в разделе Шрифт не получает завернуты. Может ли кто-нибудь мне помочь?

Пожалуйста, обратитесь следующий код:

<!DOCTYPE html> 
<html > 
    <head> 

     <link rel="stylesheet" href="../_static/js/dojo/../dijit/themes/claro/claro.css"> 

     <script>dojoConfig = {parseOnLoad: true}</script> 
     <script src='../_static/js/dojo/dojo.js'></script> 

     <script> 
      require(["dojo/parser", "dijit/Editor","dijit/_editor/plugins/FontChoice", "dijit/_editor/plugins/TextColor"]); 
     </script> 
    </head> 
    <body class="claro"> 
     <div data-dojo-type="dijit/Editor" id="editor1" data-dojo-props="onChange:function(){console.log('editor1 onChange handler: ' + arguments[0])}, 
     plugins:['cut','copy','paste','|','bold','italic','underline','strikethrough','subscript','superscript','|', 'indent', 'outdent', 'justifyLeft', 'justifyCenter', 'justifyRight','|','foreColor','hiliteColor',{name:'dijit/_editor/plugins/FontChoice', command:'fontName', generic:true}]"> 
     </div> 
    </body> 
</html> 
</div> 
+1

Можете ли вы указать * Минимальный, воспроизводимый исходный код примера * вашей проблемы? –

+0

Спасибо за ваш ответ. Я нашел, что это решение. –

+0

это по-прежнему принесет пользу сообществу, если вы * отредактировали * свой вопрос с более подробной информацией, а затем отправили ответ на свой вопрос с решением. :) –

ответ

1

Существует один плагин доступен в редакторе додзё, чтобы разбить на панели инструментов линии. Вы можете сослаться на эту ссылку для этого:

Dojo ToolbarLineBreak

Решение:

<!DOCTYPE html> 
<html > 
    <head> 

     <link rel="stylesheet" href="../_static/js/dojo/../dijit/themes/claro/claro.css"> 

     <script>dojoConfig = {parseOnLoad: true}</script> 
     <script src='../_static/js/dojo/dojo.js'></script> 

     <script> 
      require(["dojo/parser", "dijit/Editor","dijit/_editor/plugins/FontChoice", "dijit/_editor/plugins/TextColor","dojox/editor/plugins/ToolbarLineBreak"]); 
     </script> 
    </head> 
    <body class="claro"> 
     <div data-dojo-type="dijit/Editor" id="editor1" data-dojo-props="onChange:function(){console.log('editor1 onChange handler: ' + arguments[0])}, 
     plugins:['cut','copy','paste','|','bold','italic','underline','strikethrough','subscript','superscript','|', 'indent', 'outdent', 'justifyLeft', 'justifyCenter', 'justifyRight','||','foreColor','hiliteColor',{name:'dijit/_editor/plugins/FontChoice', command:'fontName', generic:true}]"> 
     </div> 
    </body> 
</html> 
</div> 

Добавить еще один плагин "dojox/редактор/плагины/ToolbarLineBreak" и использовать "||" в плагине, чтобы сломать линию, где вы хотите.

Надеюсь, если кто-то найдет решение, это поможет им.

Смежные вопросы