Merge pull request #26 from JosephHerson/patch-1
911202: Need to resolve the issue occurs when run the JS public samples
This commit is contained in:
Коммит
b1aec65037
|
@ -285,9 +285,10 @@ function combineSampleList(platform, seo, done) {
|
|||
for (var i = 0; i < orderKeys.length; i++) {
|
||||
console.log('Category : ' + orderKeys[i]);
|
||||
var components = sampleOrder[orderKeys[i]];
|
||||
let category = orderKeys[i];
|
||||
for (var j = 0; j < components.length; j++) {
|
||||
console.log('Component : ' + components[j]);
|
||||
var currentData = getSamples(data, components[j]);
|
||||
var currentData = getSamples(data, components[j], category);
|
||||
currentData.order = i;
|
||||
result.push(currentData);
|
||||
}
|
||||
|
@ -349,11 +350,11 @@ function getSampleOrder(controls) {
|
|||
return controlWiseSampleOrder;
|
||||
}
|
||||
|
||||
function getSamples(data, component) {
|
||||
function getSamples(data, component, category) {
|
||||
var dataList = Object.keys(data);
|
||||
for (var i = 0; i < dataList.length; i++) {
|
||||
var currentData = data[dataList[i]];
|
||||
if (component === currentData.name) {
|
||||
if (component === currentData.name && category === currentData.category) {
|
||||
return currentData;
|
||||
}
|
||||
}
|
||||
|
@ -464,4 +465,4 @@ gulp.task('serve', function(done) {
|
|||
};
|
||||
bs.init(options, done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче