File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ function collapsedAnswer(){
374374 $ ( ".CornerAnimayedFlex" ) . prepend ( button_Add ) ;
375375 $ ( "#collapsed-button" ) . on ( "click" , function ( ) {
376376 document . querySelectorAll ( '.ContentItem-rightButton' ) . forEach ( function ( el ) {
377- if ( el . attributes [ 0 ] . name === " data-zop-retract-question" ) {
377+ if ( el . hasAttribute ( ' data-zop-retract-question' ) ) {
378378 el . click ( )
379379 }
380380 } ) ;
@@ -397,12 +397,12 @@ function collapsedNowAnswer(selectors){
397397 }
398398 // 悬浮的 [收起回答]
399399 rightButton = rightButton . querySelector ( '.ContentItem-rightButton' )
400- if ( rightButton && rightButton . attributes [ 0 ] . name === " data-zop-retract-question" ) {
400+ if ( rightButton && rightButton . hasAttribute ( ' data-zop-retract-question' ) ) {
401401 rightButton . click ( ) ;
402402 }
403403 } else { // 固定的 [收起回答]
404404 document . querySelectorAll ( '.ContentItem-rightButton' ) . forEach ( function ( el ) {
405- if ( el . attributes [ 0 ] . name === " data-zop-retract-question" ) {
405+ if ( el . hasAttribute ( ' data-zop-retract-question' ) ) {
406406 if ( isElementInViewport ( el ) ) {
407407 // 固定的 [收起评论]
408408 let commentCollapseButton = el . parentNode . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
You can’t perform that action at this time.
0 commit comments