Permalink
Browse files

Added an error icon if "advance" does not work.

  • Loading branch information...
exhuma committed Apr 9, 2013
1 parent 95196c2 commit 0193445d39dc2961566b7e6e57083b8c1927e81b
View
@@ -28,13 +28,17 @@ lost_tracker.app.advanceState = function(event_source, groupId, stationId) {
'/advance/' + groupId + '/' + stationId,
function(evt){
var xhr = evt.target;
- var data = xhr.getResponseJson();
- if (!goog.isDefAndNotNull(data.new_state)){
- return;
- }
+ if (xhr.isSuccess()){
+ var data = xhr.getResponseJson();
+ if (!goog.isDefAndNotNull(data.new_state)){
+ return;
+ }
- elem.src = '/static/icons/' + data.new_state + '.png';
- goog.dom.classlist.add(container, 'state_' + data.new_state);
+ elem.src = '/static/icons/' + data.new_state + '.png';
+ goog.dom.classlist.add(container, 'state_' + data.new_state);
+ } else {
+ elem.src = '/static/icons/status-warning.png';
+ }
});
};
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 0193445

Please sign in to comment.