nav tabs on admin dashboard
This commit is contained in:
60
node_modules/postcss-selector-parser/dist/selectors/container.js
generated
vendored
60
node_modules/postcss-selector-parser/dist/selectors/container.js
generated
vendored
@@ -101,14 +101,17 @@ var Container = function (_Node) {
|
||||
};
|
||||
|
||||
Container.prototype.insertAfter = function insertAfter(oldNode, newNode) {
|
||||
newNode.parent = this;
|
||||
var oldIndex = this.index(oldNode);
|
||||
this.nodes.splice(oldIndex + 1, 0, newNode);
|
||||
|
||||
newNode.parent = this;
|
||||
|
||||
var index = void 0;
|
||||
for (var id in this.indexes) {
|
||||
index = this.indexes[id];
|
||||
if (oldIndex <= index) {
|
||||
this.indexes[id] = index + this.nodes.length;
|
||||
this.indexes[id] = index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,20 +119,71 @@ var Container = function (_Node) {
|
||||
};
|
||||
|
||||
Container.prototype.insertBefore = function insertBefore(oldNode, newNode) {
|
||||
newNode.parent = this;
|
||||
var oldIndex = this.index(oldNode);
|
||||
this.nodes.splice(oldIndex, 0, newNode);
|
||||
|
||||
newNode.parent = this;
|
||||
|
||||
var index = void 0;
|
||||
for (var id in this.indexes) {
|
||||
index = this.indexes[id];
|
||||
if (oldIndex <= index) {
|
||||
this.indexes[id] = index + this.nodes.length;
|
||||
if (index <= oldIndex) {
|
||||
this.indexes[id] = index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Container.prototype._findChildAtPosition = function _findChildAtPosition(line, col) {
|
||||
var found = undefined;
|
||||
this.each(function (node) {
|
||||
if (node.atPosition) {
|
||||
var foundChild = node.atPosition(line, col);
|
||||
if (foundChild) {
|
||||
found = foundChild;
|
||||
return false;
|
||||
}
|
||||
} else if (node.isAtPosition(line, col)) {
|
||||
found = node;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return found;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the most specific node at the line and column number given.
|
||||
* The source location is based on the original parsed location, locations aren't
|
||||
* updated as selector nodes are mutated.
|
||||
*
|
||||
* Note that this location is relative to the location of the first character
|
||||
* of the selector, and not the location of the selector in the overall document
|
||||
* when used in conjunction with postcss.
|
||||
*
|
||||
* If not found, returns undefined.
|
||||
* @param {number} line The line number of the node to find. (1-based index)
|
||||
* @param {number} col The column number of the node to find. (1-based index)
|
||||
*/
|
||||
|
||||
|
||||
Container.prototype.atPosition = function atPosition(line, col) {
|
||||
if (this.isAtPosition(line, col)) {
|
||||
return this._findChildAtPosition(line, col) || this;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
Container.prototype._inferEndPosition = function _inferEndPosition() {
|
||||
if (this.last && this.last.source && this.last.source.end) {
|
||||
this.source = this.source || {};
|
||||
this.source.end = this.source.end || {};
|
||||
Object.assign(this.source.end, this.last.source.end);
|
||||
}
|
||||
};
|
||||
|
||||
Container.prototype.each = function each(callback) {
|
||||
if (!this.lastEach) {
|
||||
this.lastEach = 0;
|
||||
|
||||
Reference in New Issue
Block a user