Sha256: 2b29487825b8e8b4a6c1e128dabe932fac29fe87da706a2af8b994b51947e4e1
Contents?: true
Size: 1.41 KB
Versions: 16
Compression:
Stored size: 1.41 KB
Contents
/*global Application */ ;(function($){ var load_timer; var LOADING_TEXT = 'Loading…'; var $loading = $('#loading'); var v = parseFloat($.os.version); var deviceHasNativeSupport = ($.os.ios && v >= 5) || ($.os.android && v >= 2.2); function alignLoader() { if (!deviceHasNativeSupport && $loading.css('display') === 'block') { $loading .css('position', 'absolute') .find('.loading_text') .css('margin-top', (window.pageYOffset + 80) + 'px'); } } $.showLoader = function() { if (load_timer) { window.clearTimeout(load_timer); } load_timer = setTimeout(function() { var txt = LOADING_TEXT; if (Application.currentView && Application.currentView.params.loading_text) { txt = Application.currentView.params.loading_text; } $('#loading_text').html(txt); $loading .freeze() .show(); alignLoader(); }, 333); }; $.hideLoader = function() { if (load_timer) { window.clearTimeout(load_timer); } $loading .freeze({'unfreeze':true}) .hide(); $('#app_load_loader').remove(); Application.currentView.params.loading_text = LOADING_TEXT; }; $(window).on('scroll', alignLoader); })(Zepto);
Version data entries
16 entries across 16 versions & 1 rubygems