Skip to content
Browse files

waiting style

  • Loading branch information...
1 parent c980450 commit 92752fbfe49d70f00dbad63fbfb35f6c7d32de42 @mlm79 committed
Showing with 11 additions and 5 deletions.
  1. +2 −0 public/css/style.css
  2. +4 −1 public/js/functions.js
  3. +3 −1 views/garageApp.haml
  4. +2 −3 views/index.haml
View
2 public/css/style.css
@@ -83,6 +83,8 @@ select .prompt {
margin:0;
float: left;
padding: 2px;
+ background: url("/imgs/ajax-loader.gif") no-repeat center;
+ display: none;
}
.button {
View
5 public/js/functions.js
@@ -17,12 +17,13 @@ function configureXBee() {
gateway_id: $('#gatewaySelect').val()
, xbee_id: $('#xbeeSelect').val()
}
-
+ $('#configure_img').toggle();
$.ajax({
url: '/configureXBee'
, data: params
, success: function(response){
console.log(response);
+ $('#configure_img').toggle();
$('.button').removeClass('selected').addClass('de-selected');
$('.button').unbind('click');
$('#control_panel').append("<div id='test'>Garage Door Opener Configured. Bookmark.</div>");
@@ -40,10 +41,12 @@ function toggleSensor(state){
, xbee_id: getParam('xbee_id')
, state: state
}
+ $("#"+state+"_img").toggle();
$.ajax({
url: '/toggleXBee'
, data: params
, success: function(response){
+ $("#"+state+"_img").toggle();
console.log(response);
}
View
4 views/garageApp.haml
@@ -5,6 +5,8 @@
.button.open.selected{:onclick => "toggleSensor('open');"}
%span
Open Garage
+ #open_img.thumbnail
.button.close.selected{:onclick => "toggleSensor('closed');"}
%span
- Close Garage
+ Close Garage
+ #closed_img.thumbnail
View
5 views/index.haml
@@ -15,6 +15,5 @@
/ value of xbee state
%span
Configure Garage Door Opener
- .thumbnail
- %a{:href => "", :onclick => "alert('clicked');"}
- %img{:src => "/imgs/default.png"}
+ #configure_img.thumbnail
+

0 comments on commit 92752fb

Please sign in to comment.
Something went wrong with that request. Please try again.