regexper-static/src/js/parser/javascript/charset.js

33 lines
641 B
JavaScript
Raw Normal View History

import _ from 'lodash';
import Base from './base.js';
export default _.extend({}, Base, {
2014-12-07 22:38:24 +00:00
type: 'charset',
_render() {
this.renderLabeledBox(this.invert() ? 'None of:' : 'One of:');
2014-12-07 22:38:24 +00:00
this.partContainer = this.container.group();
2014-12-09 22:48:44 +00:00
_.each(this.parts.elements, (part => {
part.render(this.partContainer.group());
2014-12-07 22:38:24 +00:00
}).bind(this));
},
_position() {
_.invoke(this.parts.elements, 'position');
2014-12-07 22:38:24 +00:00
this.spaceVertically(this.parts.elements, {
padding: 5
});
2014-12-07 22:38:24 +00:00
this.positionLabeledBox(this.partContainer, {
padding: 5
2014-12-07 22:38:24 +00:00
});
},
invert() {
return this._invert.textValue !== '';
}
});