Closed (fixed)
Project:
Contact ajax
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2017 at 13:19 UTC
Updated:
3 Aug 2022 at 07:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
leon kessler commentedThis patch the uses the
ScrollTopCommandcommand.For some reason, this command is contained within the Views module (even though it's not particularly Views specific functionality). This means we have to add the views_ajax.js to the page in order for it to work (otherwise there will be JS errors).
I've added a soft dependency on the Views module, so that the library and command are only added if it's enabled. It's not the cleanest, but will work for most people (as I can't imagine there will be many sites that will have Views disabled). For those that do not have Views, the functionality will remain as it currently is.
We also have to wrap the success message in the same wrapper, to allow the command to scroll somewhere.
Comment #3
leon kessler commentedNew patch which simplifies how the container is added and also accounts for cases where a different selector is being used.
Comment #4
leon kessler commentedOne last change. Was actually rendering the element with the
'render_selector'id (which is actually where the element should be replaced).Got rid of that, and then moved setting up the container to where the
$outputarray is started (think this is a bit clearer).Comment #5
ziomizar commentedComment #7
ziomizar commentedPushed, Many thanks!
Comment #8
ziomizar commentedComment #10
riazsaid15 commentedThanks for providing Patch.
When I submit the form using ajax in the footer. It scrolls to the top of the page rather than the top of the form.