mirror of
https://github.com/less/less.js.git
synced 2026-02-05 20:44:58 -05:00
fixed a bug when using @media with mixins
This commit is contained in:
@@ -22,22 +22,23 @@ tree.Media.prototype = {
|
||||
env.mediaBlocks = [];
|
||||
env.mediaPath = [];
|
||||
}
|
||||
|
||||
env.mediaBlocks.push(this);
|
||||
|
||||
var blockIndex = env.mediaBlocks.length;
|
||||
env.mediaPath.push(this);
|
||||
env.mediaBlocks.push(this);
|
||||
|
||||
this.features = this.features.eval(env);
|
||||
env.frames.unshift(this);
|
||||
this.ruleset = this.ruleset.eval(env);
|
||||
var media = new(tree.Media)([], []);
|
||||
media.features = this.features.eval(env);
|
||||
|
||||
env.frames.unshift(this.ruleset);
|
||||
media.ruleset = this.ruleset.eval(env);
|
||||
env.frames.shift();
|
||||
|
||||
|
||||
env.mediaBlocks[blockIndex] = media;
|
||||
env.mediaPath.pop();
|
||||
|
||||
if (env.mediaPath.length === 0) {
|
||||
return this.evalTop(env);
|
||||
} else {
|
||||
return this.evalNested(env);
|
||||
}
|
||||
return env.mediaPath.length === 0 ? media.evalTop(env) :
|
||||
media.evalNested(env)
|
||||
},
|
||||
variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
|
||||
find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
|
||||
@@ -93,9 +94,9 @@ tree.Media.prototype = {
|
||||
return new(tree.Ruleset)([], []);
|
||||
},
|
||||
permute: function (arr) {
|
||||
if (arr.length == 0) {
|
||||
if (arr.length === 0) {
|
||||
return [];
|
||||
} else if (arr.length == 1) {
|
||||
} else if (arr.length === 1) {
|
||||
return arr[0];
|
||||
} else {
|
||||
var result = [];
|
||||
|
||||
Reference in New Issue
Block a user