Advertisement
KoctrX

Untitled

Jul 13th, 2021
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. addTableClone(payload = {}, opts = {}) {
  2. const table = this.editor.DomComponents.addComponent({
  3. tagName: 'table',
  4. type: 'table_clone',
  5. removable: true,
  6. draggable: true,
  7. resizable: true,
  8. payload: {
  9. data: new Array(3).fill(null).map(q => new Array(3).fill(null).map(r => ({
  10. text: utils.randomHEX(),
  11. id: utils.uuid()
  12. })))
  13. },
  14. copyable: true,
  15. attributes: { border: 0 },
  16. 'script-props': ['payload'],
  17. style: {
  18. 'z-index': this.getZIndex()
  19. }, ...opts
  20. });
  21.  
  22. return table;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement