ToolbarLineBreak.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. define("dojox/editor/plugins/ToolbarLineBreak", [
  2. "dojo",
  3. "dijit",
  4. "dojox",
  5. "dijit/_Widget",
  6. "dijit/_TemplatedMixin",
  7. "dijit/_editor/_Plugin",
  8. "dojo/_base/connect",
  9. "dojo/_base/declare"
  10. ], function(dojo, dijit, dojox) {
  11. dojo.declare("dojox.editor.plugins.ToolbarLineBreak",
  12. [ dijit._Widget, dijit._TemplatedMixin ],
  13. {
  14. // summary:
  15. // A 'line break' between two `dijit.Toolbar` items so that very
  16. // long toolbars can be organized a bit.
  17. templateString: "<span class='dijit dijitReset'><br></span>",
  18. postCreate: function(){ dojo.setSelectable(this.domNode, false); },
  19. isFocusable: function(){
  20. // summary:
  21. // This widget isn't focusable, so pass along that fact.
  22. // tags:
  23. // protected
  24. return false;
  25. }
  26. });
  27. // Register this plugin.
  28. dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
  29. if(o.plugin){ return; }
  30. var name = o.args.name.toLowerCase();
  31. if(name === "||" || name === "toolbarlinebreak"){
  32. o.plugin = new dijit._editor._Plugin({
  33. button: new dojox.editor.plugins.ToolbarLineBreak(),
  34. setEditor: function(editor){
  35. this.editor = editor;
  36. }
  37. });
  38. }
  39. });
  40. return dojox.editor.plugins.ToolbarLineBreak;
  41. });