Removing duplicate elements from charset

This commit is contained in:
Jeff Avallone 2014-12-15 10:19:18 -05:00
parent b103982273
commit deb95ef123

View File

@ -6,13 +6,21 @@ export default _.extend({}, Base, {
type: 'charset', type: 'charset',
_render() { _render() {
var elements = _.unique(this.parts.elements, part => {
if (part.literal) {
return part.literal.textValue;
} else {
return part.textValue;
}
});
this.partContainer = this.container.group(); this.partContainer = this.container.group();
return Q.all(_.map(this.parts.elements, (part => { return Q.all(_.map(elements, (part => {
return part.render(this.partContainer.group()); return part.render(this.partContainer.group());
}).bind(this))) }).bind(this)))
.then((() => { .then((() => {
this.spaceVertically(this.parts.elements, { this.spaceVertically(elements, {
padding: 5 padding: 5
}); });