Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug#268 fix: Call multiple request while creating type items if AutoSave enabled in UCM Type #269

Open
wants to merge 3 commits into
base: release-1.2.4
Choose a base branch
from
Open
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
26 changes: 24 additions & 2 deletions src/components/com_tjucm/media/js/ui/itemform.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,37 @@ jQuery(window).load(function()
jQuery("#item-form").on("change select", ":input", function(){
if (tjUcmCurrentAutoSaveState)
{
tjUcmItemForm.onUcmFormChange(this);
// Call function if field name & value exist in request data
if (jQuery(this).attr('name') !='' && jQuery(this).attr('name') != undefined)
{
// If field is required and user tried to remove value then no need to call function
if ((jQuery(this).attr('required') == 'required' || jQuery(this).attr('required') == true) && jQuery.trim(jQuery(this).val()) =='')
{

return false;
}

tjUcmItemForm.onUcmFormChange(this);
}
}
});

/* To save calendar field value */
jQuery("#item-form .field-calendar input:text").blur(function(){
if (tjUcmCurrentAutoSaveState)
{
tjUcmItemForm.onUcmFormChange(this);
// Call function if field name & value exist in request data
if (jQuery(this).attr('name') !='' && jQuery(this).attr('name') != undefined)
{
// If field is required and user tried to remove value then no need to call function
if ((jQuery(this).attr('required') == 'required' || jQuery(this).attr('required') == true) && jQuery.trim(jQuery(this).val()) =='')
{

return false;
}

tjUcmItemForm.onUcmFormChange(this);
}
}
});

Expand Down
Loading