diff --git a/javascripts/collections/lines_weekend.js b/javascripts/collections/lines_weekend.js new file mode 100644 index 0000000..a46a2b3 --- /dev/null +++ b/javascripts/collections/lines_weekend.js @@ -0,0 +1,16 @@ +define(['backbone', 'models/line'], function(Backbone, Line) { + + var LinesWeekendCollection = Backbone.Collection.extend({ + // added callback=? to force jsonp + url: "http://api.tubeupdates.com/?method=get.status&callback=?", + + model: Line, + + parse: function(data) { + return data.response.lines; + } + }); + + return LinesWeekendCollection; + +}); diff --git a/javascripts/views/main.js b/javascripts/views/main.js index 81087fa..2a67eb4 100644 --- a/javascripts/views/main.js +++ b/javascripts/views/main.js @@ -12,9 +12,9 @@ function(Backbone) { initialize: function() { this.collection.on("request", function() { - $('#loader').show(); + $('#loader').fadeIn(100); }).on("reset", function() { - $('#loader').hide(); + $('#loader').fadeOut(100); }); }, diff --git a/stylesheets/main.css b/stylesheets/main.css index a66af72..074c553 100644 --- a/stylesheets/main.css +++ b/stylesheets/main.css @@ -52,7 +52,7 @@ body { font-family: "Helvetica Neue", "Arial", sans-serif; } #loader { - position: absolute; + position: fixed; top: 45%; left: 50%; width: 52px; @@ -60,7 +60,7 @@ body { margin: -26px 0 0 -26px; background: black url(/images/loader.gif) center center no-repeat; border-radius: 26px; - opacity: 0.5; + opacity: 0.7; display: none; } header { diff --git a/stylesheets/main.scss b/stylesheets/main.scss index 33952c1..29f5cd7 100644 --- a/stylesheets/main.scss +++ b/stylesheets/main.scss @@ -17,7 +17,7 @@ body { } #loader { - position: absolute; + position: fixed; top: 45%; left: 50%; width: 52px; @@ -25,7 +25,7 @@ body { margin: -26px 0 0 -26px; background: black url(/images/loader.gif) center center no-repeat; border-radius: 26px; - opacity: 0.5; + opacity: 0.7; display: none; }