allow concatenating attachments with /

This commit is contained in:
Konstantin Käfer 2011-02-04 15:06:31 -05:00
parent 88cf786b48
commit d165ff4302
2 changed files with 5 additions and 2 deletions

View File

@ -744,7 +744,7 @@ mess.Parser = function Parser(env) {
//
attachment: function() {
var s;
if (s = $(/^::([\w-]+)/)) {
if (s = $(/^::([\w-]+(?:\/[\w-]+)*)/)) {
// There's no object for attachment names.
return s[1];
}

View File

@ -147,7 +147,10 @@ tree.Ruleset.prototype = {
clone.filters = mergedFilters;
clone.zoom = parent.zoom & child.zoom;
clone.elements = parent.elements.concat(child.elements);
clone.attachment = child.attachment || parent.attachment;
if (parent.attachment && child.attachment) {
clone.attachment = parent.attachment + '/' + child.attachment;
}
else clone.attachment = child.attachment || parent.attachment;
clone.conditions = parent.conditions + child.conditions;
clone.index = child.index;
selectors.push(clone);