mirror of
https://github.com/danbee/tube-status-server
synced 2025-03-04 08:39:12 +00:00
36 lines
787 B
JavaScript
36 lines
787 B
JavaScript
define(['jquerymobile',
|
|
'backbone',
|
|
'mustache',
|
|
'collections/lines',
|
|
'views/line_list'],
|
|
function(a, Backbone, Mustache, LinesCollection, LineList) {
|
|
return {
|
|
initialize: function() {
|
|
var refetch = function() {
|
|
$.mobile.loading('show');
|
|
lines.fetch({
|
|
success: function() {
|
|
$.mobile.loading('hide');
|
|
}
|
|
});
|
|
}
|
|
|
|
lines = new LinesCollection;
|
|
lineList = new LineList({ collection: lines });
|
|
lines.url = lines.urls.now;
|
|
|
|
lines.fetch();
|
|
|
|
$('#refresh').on("click", function() {
|
|
refetch();
|
|
return false;
|
|
});
|
|
|
|
$('footer a').on("click", function() {
|
|
lines.url = lines.urls[this.id];
|
|
refetch();
|
|
});
|
|
}
|
|
};
|
|
});
|