Loading bar: Introduced two event listeners on window 'pillar:workStart' and 'pillar:workStop' that (de)activates the loading bar.
Reason: * To decouple code * Have the loading bar active until whole page stopped working * Have local loading info Usage: $.('.myClass') .on('pillar:workStart', function(){ ... do stuff locally while loading ... }) .on('pillar:workStop', function(){ ... stop do stuff locally while loading ... }) $.('.myClass .mySubClass').trigger('pillar:workStart') ... do stuff ... $.('.myClass .mySubClass').trigger('pillar:workStop')
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
if (!node.picture) {
|
||||
warnNoPicture();
|
||||
} else {
|
||||
loadingBarShow();
|
||||
$(window).trigger('pillar:workStart');
|
||||
|
||||
// TODO: show 'loading' thingy
|
||||
$.get('/api/files/' + node.picture)
|
||||
@@ -34,7 +34,6 @@
|
||||
console.log(msg);
|
||||
})
|
||||
.done(function(resp) {
|
||||
loadingBarHide();
|
||||
|
||||
// Render the picture if it has the proper size.
|
||||
var show_variation = null;
|
||||
@@ -57,6 +56,9 @@
|
||||
.attr('width', variation.width)
|
||||
.attr('height', variation.height);
|
||||
thumbnail_container.append(img);
|
||||
})
|
||||
.always(function(){
|
||||
$(window).trigger('pillar:workStop');
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user