-
-
Save cmcculloh/cc380cc50e2d9fe6c015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
showLoading: function showLoading(msg) { | |
var loading = app.views.get('loading'); | |
if (typeof msg === "undefined") { | |
msg = "Loading, please wait..."; | |
} | |
//render to put new error message in there if already visible | |
if (loading.isVisible) { | |
loading.render(); | |
} else {//otherweise, show it | |
loading.isVisible = true; | |
app.loadingRegion.show(app.views.get('loading')); | |
app.loadingRegion.$el.find(".progress .bar").width("100%"); | |
} | |
}, | |
hideLoading: function hideLoading() { | |
var loading = app.views.get('loading'); | |
loading.isVisible = false; | |
app.loadingRegion.close(); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.addRegions({ | |
mainRegion: '#main', | |
/*navRegion: '#nav',*/ | |
loadingRegion: '#loading' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
var Marionette = require('backbone.marionette'); | |
return Marionette.ItemView.extend({ | |
template: require('tmpl!templates/loading.html') | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment