Sha256: 4d3812bbc27575dbeb5bf1f9d862d3ac4664268546c7c7a26c069ff7f8b3b173

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

;(function() {

    // Delay loading of images to make sure they load last.
    // Also, enable retina images.
    var delayed_load = function() {

        $('.delayed_load').not('.processed').each(function() {

            var src = $(this).data('src');

            if (window.devicePixelRatio > 1)  {
                src = src.replace(/\.png/g, '@2x.png');
            }

            if (src) {
                $(this)
                    .attr('src', src)
                    .addClass('processed');
            } else {
                $(this).remove();
                console.log("Removing image: " + this);
            }

        });

    };

    $(document.body)
        .on('Application:viewAppended', delayed_load)
        .on('tabUpdated', delayed_load);

    $(document.body).on('Logo:Error', function(e) {
        if ($(e.target).data('fxdlogo')) return;

        // NBA3 should use `Application.params.MISSING_LOGO`
        $(e.target)
            .attr('src', Application.params.imageHost + 'logos/DivisionIAA_25x25@2x.png')
            .data('fxdlogo', true);

    });

})();

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sports_db-0.2.12 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.11 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.10 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.9 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.8 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.7 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.6 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.5 app/assets/javascripts/plugins/delayed_load.js
sports_db-0.2.4 app/assets/javascripts/plugins/delayed_load.js