Browse Source

Fix TableRow model component. Closes #2697

pull/2732/head
Artur Arseniev 6 years ago
parent
commit
9a3d0e11b5
  1. 21
      src/dom_components/model/ComponentTableRow.js

21
src/dom_components/model/ComponentTableRow.js

@ -4,31 +4,12 @@ export default Component.extend(
{
defaults: {
...Component.prototype.defaults,
type: 'row',
tagName: 'tr',
draggable: ['thead', 'tbody', 'tfoot'],
droppable: ['th', 'td']
},
initialize(o, opt) {
Component.prototype.initialize.apply(this, arguments);
// Clean the row from non cell components
const cells = [];
const components = this.get('components');
components.each(model => model.is('cell') && cells.push(model));
components.reset(cells);
}
},
{
isComponent(el) {
let result = '';
if (el.tagName == 'TR') {
result = { type: 'row' };
}
return result;
}
isComponent: el => el.tagName == 'TR' && true
}
);

Loading…
Cancel
Save