Commit 3213e727 authored by yPhil's avatar yPhil
Browse files

UI: One loader to notify them all

parent d4e81782
......@@ -42,11 +42,11 @@ MOB.dialog = {
// MOB.tab.populate(JSON.parse(MOB.prefs.readConfig('tabs')));
$rightSources.click(function() {
MOB.tab.populate(JSON.parse(MOB.prefs.collection('rightFr')));
MOB.tab.populate(JSON.parse(MOB.prefs.collection('rightFr')), true, true);
});
$leftSources.click(function() {
MOB.tab.populate(JSON.parse(MOB.prefs.collection('leftFr')));
MOB.tab.populate(JSON.parse(MOB.prefs.collection('leftFr')), true, true);
});
$noSources.click(function() {
......
......@@ -165,12 +165,21 @@ MOB.prefs = (function() {
}
},
writeConfig:function(key, val) {
$('#progressBar').fadeToggle('fast');
// $('#savingIcon').fadeToggle('fast');
localStorage.setItem(key, val);
// $('#savingIcon').fadeToggle('slow');
$('#progressBar').fadeToggle('slow');
writeConfig:function(key, val) {
var $loader = $('#loadRadial');
$loader.attr('class', 'c100 small green dark p100');
$loader.children('span').text('');
$loader.fadeToggle('fast');
// $('#savingIcon').fadeToggle('fast');
localStorage.setItem(key, val);
// $('#savingIcon').fadeToggle('slow');
$loader.fadeToggle('slow');
// $('#loadRadial').attr('class', 'c100 small green dark p0');
},
exportConfig:function(data, fileName) {
var a = document.createElement("a");
......
......@@ -10,14 +10,19 @@ MOB.tab = {
MOB.tab.saveTabs();
MOB.tab.makeNewTabButton($('div#tabs'));
},
populate:function(tabs, clickToRefresh) {
populate:function(tabs, clickToRefresh, add) {
$('div#tabs ul li').remove();
$('div#tabs div').remove();
if (add) {
console.log('ADD!');
} else {
$('div#tabs div').remove();
$('div#tabs ul li').remove();
MOB.tab.makeNewTabButton($('div#tabs'));
}
var totalFeeds = 0;
MOB.tab.makeNewTabButton($('div#tabs'));
tabs.forEach(function(tab) {
totalFeeds += tab.feeds.length;
......
......@@ -187,17 +187,17 @@ MOB.utilities = {
var progress = { step: 0 };
progress.init = function( steps ) {
this.progressContainer = $('<div id="progressBar">' );
this.progressElt = $('<div id="cursor">' );
// this.progressContainer = $('<div id="progressBar">' );
// this.progressElt = $('<div id="cursor">' );
this.radialLoader = $('#loadRadial');
this.radialLoaderLabel = $('#loadRadial > span');
this.radialLoader.fadeIn('fast');
this.progressContainer.append( this.progressElt );
$('body').prepend(this.progressContainer);
// this.progressContainer.append( this.progressElt );
// $('body').prepend(this.progressContainer);
this.steps = steps;
this.go();
// this.go();
};
progress.increment = function() {
......@@ -205,24 +205,24 @@ MOB.utilities = {
this.radialLoaderLabel.text(Math.ceil(100 * this.step / this.steps) + '%');
this.progressElt.animate({
width: Math.ceil(100 * this.step / this.steps) + '%'
// ,'background-color': randomColor
});
// this.progressElt.animate({
// width: Math.ceil(100 * this.step / this.steps) + '%'
// });
this.step++;
if (this.step >= this.steps) this.finish();
};
progress.finish = function() {
var self = this;
self.progressContainer.hide('fast');
// self.progressContainer.hide('fast');
self.radialLoader.fadeOut('fast');
};
progress.stop = function() {
this.progressElt.removeClass( 'progress-bar-striped active' );
// this.progressElt.removeClass( 'progress-bar-striped active' );
};
progress.go = function() {
this.progressElt.addClass( 'progress-bar-striped active' );
// this.progressElt.addClass( 'progress-bar-striped active' );
};
return progress;
......
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