Skip to content

Commit

Permalink
Adding loading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
David committed Dec 27, 2011
1 parent ce5326d commit 390af2f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/css/subway.css
Expand Up @@ -48,6 +48,11 @@
cursor: pointer;
}

#overview form #loading_image{
position: fixed;
margin-left: 10px;
}

#channels{
margin-top: 25px;
}
Expand Down
Binary file added assets/images/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/js/views/overview.js
Expand Up @@ -16,6 +16,21 @@ var OverViewView = Backbone.View.extend({
$('#overview').html(func());
}
$('.overview_button').bind('click', jQuery.proxy(this.render, this));
$('#connect_button').bind('click', function(){
$('.error').removeClass('error');
if(!$('#connect_server').val()) {
$('#connect_server').closest('.clearfix').addClass('error');
$('#connect_server').addClass('error');
}
if(!$('#connect_nick').val()) {
$('#connect_nick').closest('.clearfix').addClass('error');
$('#connect_nick').addClass('error');
}
if($('#connect_nick').val() && $('#connect_server')) {
$('form').append(ich.load_image());
$('#connect_button').addClass('disabled');
}
});
return this;
}
});
1 change: 1 addition & 0 deletions views/layout.jade
Expand Up @@ -11,5 +11,6 @@ html
include templates/overview_home_template
include templates/overview_connection_template
include templates/overview_settings_template
include templates/load_image_template
body
block content
2 changes: 2 additions & 0 deletions views/templates/load_image_template.jade
@@ -0,0 +1,2 @@
script(id="load_image", type="text/html")
img(id="loading_image", src="/assets/images/loading.gif")

0 comments on commit 390af2f

Please sign in to comment.