User:DR/common.js: Difference between revisions
From Test Wiki
Content deleted Content added
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
'use strict'; |
'use strict'; |
||
if (window.location.search.includes('action=delete')) { |
if (window.location.search.includes('action=delete')) { |
||
var observer = new MutationObserver(function(mutations) { |
|||
mutations.forEach(function(mutation) { |
|||
var reasonInput = document.querySelector('input[name="wpReason"]'); |
|||
if ( |
if (mutation.addedNodes.length) { |
||
reasonInput |
var reasonInput = document.querySelector('input[name="wpReason"]'); |
||
if (reasonInput) { |
|||
reasonInput.value = ''; |
|||
observer.disconnect(); |
|||
} |
|||
} |
|||
}); |
|||
}); |
}); |
||
observer.observe(document.body, { childList: true, subtree: true }); |
|||
} |
} |
||
})(); |
})(); |
||