Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support button elements in ajax popups #14136
This adds support for "button" elements in CiviCRM ajax popup forms in addition to the input type=button/submit and the "a class=button".
Related to https://lab.civicrm.org/dev/core/issues/347
This is a first step towards cleaning up button handling from a theming perspective as currently the ajax popups require buttons to be in the two specific formats and the "span" with an icon + link is notoriously difficult to theme.
This change opens up the possibility to replace "all" form buttons, for example by modifying "formButtons.tpl" like this: 9a05a2a - that part is trivial to do via an extension.
Button types tightly coupled to ajax popups
Slightly more standard button types allowed for ajax popups. More flexibility for themes.
It is nearly impossible to sensible override crm.ajax.js via extension as it is tied to a specific order of loading here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Resources.php#L724 and things break if loaded later (eg. via extension hook).
tho @mattwire Bootstrap uses
Not wanting to piggyback on this to the wider question of front-end theme/css framework integration, but the first question on my interface notes here - https://pad.riseup.net/p/civicrm-interface seems a little relevant – should, & how should, there be css framework integration within Civi?
@colemanw A core change to crm.ajax.js in cdef34e#diff-13e5d322033454d3b6e51caa3d59ae86 means I either need to get this merged quickly or add some code to support old/new versions of CiviCRM in https://github.com/mattwire/civicrm-haystacktheme
Given this is now just a one-line change and has been reviewed already are you happy to merge @colemanw That way I don't need to override the file at all from 5.15/16 :-)