Merge pull request #871 from universe-st/PR-Branch-eff
因同步原因,去除MutatableObserver对getCards的优化逻辑
This commit is contained in:
commit
6b6ebfb2ef
|
@ -2271,14 +2271,8 @@ export class Get extends Uninstantable {
|
|||
static *iterableChildNodes(node){
|
||||
for(let i=0;i<arguments.length;i++){
|
||||
let arg = arguments[i];
|
||||
if(arg._childNodesWatcher){
|
||||
for(let child of arg._childNodesWatcher.childNodes){
|
||||
yield child;
|
||||
}
|
||||
}else{
|
||||
for(let j=0;j<arg.childElementCount;j++){
|
||||
yield arg.childNodes[j];
|
||||
}
|
||||
for(let j=0;j<arg.childElementCount;j++){
|
||||
yield arg.childNodes[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
export class ChildNodesWatcher{
|
||||
constructor(dom){
|
||||
this.dom = dom;
|
||||
this.childNodes = [];
|
||||
this.observer = new MutationObserver(mutationsList=>{
|
||||
for (let mutation of mutationsList) {
|
||||
|
@ -16,7 +17,7 @@ export class ChildNodesWatcher{
|
|||
}
|
||||
|
||||
onChildNodesChanged(addedNodes,removedNodes) {
|
||||
this.childNodes.addArray(Array.from(addedNodes));
|
||||
this.childNodes.addArray(Array.from(addedNodes).filter(node=>node.parentNode == this.dom));
|
||||
this.childNodes.removeArray(Array.from(removedNodes));
|
||||
}
|
||||
};
|
|
@ -3234,7 +3234,7 @@ export class Player extends HTMLDivElement {
|
|||
value = getCardName(card);
|
||||
}
|
||||
else {
|
||||
value = cards[i][j];
|
||||
value = card[j];
|
||||
}
|
||||
if ((typeof arg2[j] == 'string' && value != arg2[j]) ||
|
||||
(Array.isArray(arg2[j]) && !arg2[j].includes(value))) {
|
||||
|
|
Loading…
Reference in New Issue