andersonmanufacturing.com Open in urlscan Pro
52.158.208.22  Public Scan

URL: https://andersonmanufacturing.com/static/version1698750256/frontend/Magentomaster/theme205/en_US/Epicor_Comm/epicor/comm/js/messag...
Submission: On November 07 via manual from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

/**
 * Copyright © 2010-2018 Epicor Software Corporation: All Rights Reserved
 */

/*jshint browser:true jquery:true*/
/*global alert*/
define([
    'jquery'
], function($) {
    'use strict';
    return function(targetModule) {
        return targetModule.extend({
            isVisible: function () {
                var self = this,
                    element = $(self.selector);
                if(!this.messageContainer.hasMessages()){
                    element.hide();
                }
                return this.isHidden(this.messageContainer.hasMessages());
            },
            onHiddenChange: function (isHidden) {
                var self = this,
                    element = $(self.selector);
                this.onErrorFocus(element);
            },
            onErrorFocus: function (errorElement) {
                if (typeof errorElement !== 'undefined') {
                    var windowHeight = $(window).height();
                    $('html, body').animate({
                        scrollTop: errorElement.parent().closest('div').offset().top - windowHeight / 3
                    });
                }
            }
        });
    };

});