我有一些CSS代码,只想在某个页面ID上运行。从历史上看,这并不是什么大问题,但是我距离CSS专家不远。下面是使表格移动友好的代码,它很好用!但是,它在所有页面上运行,而不仅仅是我为其设置的一个页面ID。
var makeApiCalls = function(workerId) {
var Model = mongoose.model('Tweet'.concat(workerId), Tweet.tweetSchema);
return Model.find({}, {
_id: 1,
message: 1,
resultOfTheCall: 1
}).then(messages => {
// filter the mssages here those for which to make the call and the others
var toCallArray = messages.filter(x => x.resultOfTheCall == null)
var noCallArray = messages.filter(x => x.resultOfTheCall != null)
// now do the calls for only those which do not have resultOfTheCall
return Promise.all(
toCallArray.map(({_id, message}) =>
api.sentiment(message).then(result =>
Model.findOneAndUpdate({
_id
}, {
resultOfTheCall: result
}, {
new: true
})
.then(updated => {
console.log(updated);
return [...noCallArray, ...toCallArray]
})
)
)
)
})
};
}
我哪里出错了?
答案 0 :(得分:0)
谢谢@josephmarikle,让我走上正确的道路。我需要具体确定使它工作所需的表。
/* Force table to not be like tables anymore */
.page-id-17075 #wpsm-table-1,
.wpsm-tbody tbody,
.wpsm-tbody th,
.wpsm-tbody td,
.wpsm-tbody tr { display: block; }