Browse Source

Add ComponentLabel and avoid its bounds via for. Closes #316

pull/1130/head
Artur Arseniev 8 years ago
parent
commit
8ffa7410af
  1. 5
      src/dom_components/index.js
  2. 18
      src/dom_components/model/ComponentLabel.js
  3. 1
      src/dom_components/view/ComponentLabelView.js

5
src/dom_components/index.js

@ -83,6 +83,11 @@ module.exports = () => {
model: require('./model/ComponentLink'),
view: require('./view/ComponentLinkView')
},
{
id: 'label',
model: require('./model/ComponentLabel'),
view: require('./view/ComponentLabelView')
},
{
id: 'video',
model: require('./model/ComponentVideo'),

18
src/dom_components/model/ComponentLabel.js

@ -0,0 +1,18 @@
import Component from './ComponentText';
module.exports = Component.extend(
{
defaults: {
...Component.prototype.defaults,
tagName: 'label',
traits: ['id', 'title', 'for']
}
},
{
isComponent(el) {
if (el.tagName == 'LABEL') {
return { type: 'label' };
}
}
}
);

1
src/dom_components/view/ComponentLabelView.js

@ -0,0 +1 @@
module.exports = require('./ComponentLinkView').extend({});
Loading…
Cancel
Save