64 lines
2.1 KiB
JavaScript
64 lines
2.1 KiB
JavaScript
/*
|
|
* Account page scripts.
|
|
*/
|
|
(function (win, doc, undef)
|
|
{
|
|
//--------------------------------------------------------------
|
|
"use strict";
|
|
sax.classFileDrag = 'sax-file-drag';
|
|
let $pnl = sax.$pnl, $dlg = sax.$dlg, $frm = sax.$frm;
|
|
sax.profile = { contact: {}, sports: {}, organisations: {} };
|
|
//--------------------------------------------------------------
|
|
sax.refreshProfile = function ()
|
|
{
|
|
setTimeout(sax.refreshProfileContactInfo, 50);
|
|
setTimeout(sax.refreshProfileEligibilityInfo, 50);
|
|
setTimeout(sax.refreshProfileSportsInfo, 50);
|
|
setTimeout(sax.refreshProfileOrganisationsInfo, 50);
|
|
}
|
|
//--------------------------------------------------------------
|
|
sax.showDataRefreshingMsg = function ($section)
|
|
{
|
|
//$('.sax-message', $section).html(sax.msg.dataRefreshing).fadeIn(200);
|
|
}
|
|
sax.showNoInfoMsg = function ($section)
|
|
{
|
|
if (!$('.sax-value', $section).text().length)
|
|
$('.sax-message', $section).html(sax.msg.noInformation).fadeIn(200);
|
|
}
|
|
sax.closeEditPanels = function ()
|
|
{
|
|
if (sax.page.profileContactChanged || sax.page.profileEligibilityChanged || sax.page.profileSportsChanged || sax.page.profileOrganisationsChanged)
|
|
{
|
|
sax.doAlert(sax.msg.changesMade);
|
|
return false;
|
|
}
|
|
$('.sax-panel-section').removeClass('sax-edit');
|
|
return true;
|
|
}
|
|
sax.refreshInfo = function ($section, name, value)
|
|
{
|
|
$('.sax-property.' + name + ' .sax-value', $section).html(value).closest('.sax-property').toggle(!!value);
|
|
}
|
|
sax.refreshInput = function ($section, name, value)
|
|
{
|
|
$('.sax-control input.' + name, $section).val(value);
|
|
}
|
|
sax.refreshTextArea = function ($section, name, value)
|
|
{
|
|
$('.sax-control textarea.' + name, $section).val(value);
|
|
}
|
|
sax.refreshSelect = function ($section, name, value)
|
|
{
|
|
var $select = $('.sax-control select.' + name, $section);
|
|
$select.val(value).scrollTop(0);
|
|
sax.setItemsSelectedInfo($select);
|
|
}
|
|
//--------------------------------------------------------------
|
|
$(function ()
|
|
{
|
|
setTimeout(sax.refreshProfile, 200);
|
|
});
|
|
//--------------------------------------------------------------
|
|
}(window, window.document));
|
|
/* The End */ |