This commit is contained in:
Chris Rebert 2014-09-23 14:26:26 -07:00
Родитель 747dc1c5e3
Коммит 7f38914574
1 изменённых файлов: 15 добавлений и 5 удалений

20
dist/browser/bootlint.js поставляемый
Просмотреть файл

@ -9299,10 +9299,20 @@ var cheerio = require('cheerio');
var notAnyColClass = COL_CLASSES.map(function (colClass) {
return ':not(' + colClass + ')';
}).join('');
var selector = '*:not(.container):not(.container-fluid):not(.bs-example)' + notAnyColClass + '>.row';
var rowsOutsideContainers = $(selector);
if (rowsOutsideContainers.length) {
return "Found one or more `.row`s that were not children of a grid column or `.container` or `.container-fluid`";
var selector = '*:not(.bs-example)' + notAnyColClass + '>.row';
var rowsOutsideColumns = $(selector);
var rowsOutsideColumnsAndContainers = rowsOutsideColumns.filter(function (i, row) {
var parent = $(row);
while (parent.length) {
if (parent.hasClass('container') || parent.hasClass('container-fluid')) {
return false;
}
parent = $(parent).parent();
}
return true;
});
if (rowsOutsideColumnsAndContainers.length) {
return "Found one or more `.row`s that were not children of a grid column or descendants of a `.container` or `.container-fluid`";
}
};
exports.lintNestedContainers = function ($) {
@ -9446,7 +9456,7 @@ var cheerio = require('cheerio');
};
exports.lintColParentsAreRowsOrFormGroups = function ($) {
var selector = COL_CLASSES.map(function (colClass) {
return '*:not(.row):not(.form-group)>' + colClass;
return '*:not(.row):not(.form-group)>' + colClass + ':not(col):not(th):not(td)';
}).join(',');
var colsOutsideRowsAndFormGroups = $(selector);