Ticket #1538: tablelinebreak.diff

File tablelinebreak.diff, 1.6 KB (added by guest, 9 years ago)
  • plugins/TableOperations/TableOperations.js

     
    1515// Object that will encapsulate all the table operations provided by 
    1616// HTMLArea-3.0 (except "insert table" which is included in the main file) 
    1717Xinha.Config.prototype.TableOperations = { 
    18   'showButtons' : true // Set to false to hide all but inserttable and toggleborders buttons on the toolbar 
     18  'showButtons' : true, // Set to false to hide all but inserttable and toggleborders buttons on the toolbar 
    1919  // this is useful if you have the ContextMenu plugin and want to save toolbar space 
    2020  // (the context menu can perform all the button operations) 
     21  'forceToolbarLineBreak': true // By default TableOperations puts all of its buttons on their own row. 
     22  // Set to false to prevent this and instead just append the buttons without injecting a linebreak. 
    2123} 
    2224 
    2325function TableOperations(editor) { 
     
    3234  // Remove existing inserttable and toggleborders, we will replace it in our group   
    3335  cfg.removeToolbarElement(' inserttable toggleborders ');  
    3436   
    35   var toolbar = ["linebreak", "inserttable", "toggleborders"]; 
     37  var toolbar; 
     38  if( cfg.TableOperations.forceToolbarLineBreak ) { 
     39    toolbar = ["linebreak", "inserttable", "toggleborders"]; 
     40  } else {  
     41    toolbar = ["inserttable", "toggleborders"]; 
     42  }   
    3643   
    37    
    3844  for (var i = 0; i < bl.length; ++i) { 
    3945    var btn = bl[i]; 
    4046    if (!btn) {