Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions media/system/js/associations-edit-uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ window.hideAssociation = function(formControl, languageCode)
jQuery('#associations .control-group').each(function()
{
// Current selected language. Hide it.
if (jQuery(this).find('.control-label label').attr('for').replace('_id', '') == formControl + '_associations_' + languageCode.replace('-', '_'))
if (jQuery(this).find('.control-label label').attr('for').replace(new RegExp('_id$'), '') == formControl + '_associations_' + languageCode.replace('-', '_'))
{
jQuery(this).hide();
}
Expand All @@ -33,25 +33,25 @@ window.showAssociationMessage = function()
/**
* Inject associations into other association fields
*
* This function is called whenever the Ajax request within propagateAssociation() completes successfully.
* This function is called whenever the Ajax request within propagateAssociation() completes successfully.
* Its purpose is to inject the associations which have been returned in the Ajax response into the other
* association fields in the form.
* association fields in the form.
* It does this by invoking the various callback functions of those association fields (i.e. the function which
* gets called whenever the administrator selects an association via the modal), and passing the appropriate
* associated record details.
*
* @param js object result The response from the Ajax request.
* Its structure is that generated by the JResponseJson class,
* @param js object result The response from the Ajax request.
* Its structure is that generated by the JResponseJson class,
* with the data field containing the associations
* @param string fieldPrefix The stem of the html ids for the elements comprising the modal field
* @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the
* @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the
* selected item as the association, but minus the language tag at the end
*
* @return boolean
*
* @since 3.9.0
*/
Joomla.injectAssociations = function(result, callbackFunctionPrefix)
Joomla.injectAssociations = function(result, callbackFunctionPrefix)
{
var functionName;

Expand Down Expand Up @@ -81,26 +81,26 @@ window.showAssociationMessage = function()
/**
* Propagate associations from this field into other association fields
*
* This function is called whenever an administrator populates an association (in the association modal field)
* and then clicks on the Propagate button.
* The purpose of this function is to find what other records (if any) are associated with the one which the
* This function is called whenever an administrator populates an association (in the association modal field)
* and then clicks on the Propagate button.
* The purpose of this function is to find what other records (if any) are associated with the one which the
* administrator has selected, and populate the other association fields with these records. (Otherwise, if the
* administrator just clicks on Save without clicking on Propagate, those other associations will be deleted).
* It does this by finding the id of the selected associated record (from a hidden field) and makes an Ajax call
* to the server to find the other associations, also passing up the language of the record currently being edited,
* as it should be excluded.
* as it should be excluded.
* Once it has received from the server the other associations it calls injectAssociations to inject them into
* the other association fields within the form.
* the other association fields within the form.
*
* @param string fieldPrefix The stem of the html ids for the elements comprising the modal field
* @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the
* @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the
* selected item as the association, but minus the language tag at the end
*
* @return boolean
*
* @since 3.9.0
*/
Joomla.propagateAssociation = function(fieldPrefix, callbackFunctionPrefix)
Joomla.propagateAssociation = function(fieldPrefix, callbackFunctionPrefix)
{
// Find the id of the record which has been set as an assocation
var assocId = jQuery("#" + fieldPrefix + "_id").val();
Expand Down Expand Up @@ -131,7 +131,7 @@ window.showAssociationMessage = function()
!(function()
{
jQuery(document).ready(function($)
{
{
var associationsEditOptions = Joomla.getOptions('system.associations.edit'), formControl = associationsEditOptions.formControl || 'jform';

// Hide the associations tab if needed.
Expand Down
2 changes: 1 addition & 1 deletion media/system/js/associations-edit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.