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

32 lines
632 B
JavaScript
Raw Normal View History

import _ from 'lodash';
import Q from 'q';
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();
return Q.all(_.map(this.parts.elements, (part => {
return part.render(this.partContainer.group());
}).bind(this)));
2014-12-07 22:38:24 +00:00
},
_position() {
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 !== '';
}
});