View Issue Details

IDProjectCategoryView StatusLast Update
0003647Composr alpha bug reports[All Projects] General / Uncategorisedpublic2018-09-03 20:26
ReporterChris GrahamAssigned ToSalman 
SeverityFeature-request 
Status resolvedResolutionfixed 
Summary0003647: Block AJAX loading
DescriptionI have merged in my staff actions block changes (Admin Zone dashboard). However, the AJAX browsing isn't working.

Changing the filters should work dynamically.
It's doing:
            $dom.trigger(el, 'submit');

(In v10 this would have been calling onsubmit(), but I think you're likely using proper event listeners now).

Pagination should also work via AJAX.

I suspect your AJAX block reload code is broken and this is highlighting it.
TagsNo tags attached.
Sponsorship open0

Activities

Salman

2018-07-30 22:48

reporter   ~0005780

There were a few issues that I fixed:

1. Many calls to $dom.internaliseAjaxBlockWrapperLinks() had a wrong parameter name, sorry about this :(.
2. After fixing above, the "internalising" was only working once because when new HTML was loaded via AJAX, $dom.internaliseAjaxBlockWrapperLinks() wasn't getting called afterwards to attach event listeners to the new links and forms. This is because we got rid of inline <script> tags, we now use "behaviors" instead which are applied any time new HTML is inserted using $dom.* functions. They are called on an element using data attributes. So I added a behavior named [data-ajaxify-links] to fix this.
3. The on-change event listeners attached for triggering the form submit event were also lost when loading new HTML, this is where event delegation shines. I simply added a 'js-onchange-submit-form' class to the relevant elements and added this to the template function: $dom.on(container, 'change', '.js-onchange-submit-form', function (e, el) { $dom.trigger(el.form, 'submit'); });.
4. The submit event needed to be triggered on the form, not the input elements: $dom.trigger(el, 'submit'); -> $dom.trigger(el.form, 'submit');

So the main_staff_actions block is working now but other stuff using $dom.internaliseAjaxBlockWrapperLinks() is probably broken as well :(, testing/fixing that now.

Issue History

Date Modified Username Field Change
2018-07-29 19:01 Chris Graham New Issue
2018-07-29 19:01 Chris Graham Status non-assigned => assigned
2018-07-29 19:01 Chris Graham Assigned To => Salman
2018-07-30 22:48 Salman Note Added: 0005780
2018-09-03 20:26 Salman Status assigned => resolved
2018-09-03 20:26 Salman Resolution open => fixed
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised