Commit 50aff1ee authored by RyanHerb's avatar RyanHerb

database.js, main.js resolve scope issues

Introducing the upload check revealed an issue with scope.
Due to the closure being passed to setTimeout, all scope was lost and it
was not possible to reference the database attributes
parent 906aebaf
......@@ -984,7 +984,7 @@ Database.prototype = {
},
ajax_indicator_start: function() {
if (!self.uploader.is_uploading()) {
if (!(this.uploader.is_uploading())) {
var tgt = $('#live-ajax');
tgt.empty();
$('<img/>', {src: 'images/ajax-loader.gif'}).appendTo($('<div/>', {class: 'active-container'}).appendTo(tgt));
......
......@@ -94,7 +94,9 @@ console.log("=== main.js finished ===");
var timeout;
$(document).ajaxStart(function () {
//show ajax indicator
timeout = setTimeout(db.ajax_indicator_start, 600);
timeout = setTimeout(function(){
db.ajax_indicator_start()
}, 600);
}).ajaxStop(function () {
//hide ajax indicator
db.ajax_indicator_stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment