User tests: Successful: Unsuccessful:
After removing inline js we broke posibility to use these with dinamic content, eg content loaded with ajax.
Not used in core, but other developers may use it.
Apply patch, run npm install
Add to index.php of admin template (ajax simulator, will add "Reload" button on the page):
<script type="module">
const btn = document.createElement('button');
btn.type = 'button';
btn.textContent = 'Reload';
window.content.insertAdjacentElement('afterbegin', btn);
btn.addEventListener('click', () => {
fetch('index.php?option=com_content&view=articles&tmpl=component').then((resp) => resp.text()).then((resp) => {
const temp = document.createElement('template');
temp.innerHTML = resp;
const container = window.adminForm.parentElement;
container.removeChild(window.adminForm);
container.appendChild(temp.content.querySelector('#adminForm'));
container.dispatchEvent(new CustomEvent('joomla:updated', {bubbles: true, cancelable: true}));
})
});
</script>
Go to Articles view:
Click unpublish/publish;
Click "Reload" button;
Click unpublish/publish again;
First click "unpublish/publish" works
Second click "unpublish/publish" does not works
First click "unpublish/publish" works
Second click "unpublish/publish" works
Please select:
Category | ⇒ | JavaScript Repository NPM Change |
Status | New | ⇒ | Pending |
Labels |
Added:
NPM Resource Changed
bug
PR-4.3-dev
|
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-18 14:49:59 |
Closed_By | ⇒ | obuisard |
@Fedik I didn't thought that these could be in a dynamically generated content. Good catch