/**
 * @description A variable used for purposes of namespacing functions.
 * @example iconLoadingIndicator.showLoadingIcon('myElementToShow', 'myElementToHide');
 */
var iconLoadIndicator = {
    /**
     * @description Shows the specified loading element and hides the specified not loading element.
     * @param loadingElementId The Id of the element to show.
     * @param notLoadingElementId The Id of the element to hide.
     * @example iconLoadingIndicator.showLoadingIcon('myElementToShow', 'myElementToHide');
     */
    showLoadingIcon: function(loadingElementId, notLoadingElementId) {
        // Show the loading element, hide the not loading element.
        jQuery(loadingElementId).show();
        jQuery(notLoadingElementId).hide();
    },

    /**
     * @description Hides the specified loading element and shows the specified not loading element.
     * @param loadingElementId The Id of the element to hide.
     * @param notLoadingElementId The Id of the element to show.
     * @example iconLoadingIndicator.hideLoadingIcon('myElementToHide', 'myElementToShow');
     */
    hideLoadingIcon: function(loadingElementId, notLoadingElementId) {
        // Hide the loading element, show the not loading element.
        jQuery(loadingElementId).hide();
        jQuery(notLoadingElementId).show();
    },

    /**
     * @description Disables the specified comma separated element selectors.
     * @param elementsToDisable A String containing jQuery appropriate selectors for elements to disable.
     * @example iconLoadingIndicator.disableElements('.m-search-input,.m-search-button');
     */
    disableElements: function(elementsToDisable) {
        // Since this is optional, check to see if it has a value before proceeding.
        if (typeof elementsToDisable === 'undefined' || elementsToDisable === null || elementsToDisable === '') {
            return;
        }

        // Disable elements.
        jQuery(elementsToDisable).prop('disabled', true);
    },

    /**
     * @description Enables the specified comma separated element selectors.
     * @param elementsToEnable A String containing jQuery appropriate selectors for elements to enable.
     * @example iconLoadingIndicator.enableElements('.m-search-input,.m-search-button');
     */
    enableElements: function(elementsToEnable) {
        // Since this is optional, check to see if it has a value before proceeding.
        if (typeof elementsToEnable === 'undefined' || elementsToEnable === null || elementsToEnable === '') {
            return;
        }

        // Re-enable elements.
        jQuery(elementsToEnable).prop('disabled', false);
    }
};