Skip to content

Commit

Permalink
Merge pull request #423 from /issues/343/1
Browse files Browse the repository at this point in the history
Fixes #343 - Use flash:error event in issue model.
  • Loading branch information
magsout committed Nov 25, 2014
2 parents 84d3087 + e465834 commit 21680ef
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions webcompat/static/js/lib/models/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,8 @@
}
},
error: function() {
$('<div></div>', {
'class': 'flash error',
'text': 'There was an error editing this issues\'s status.'
}).appendTo('body');

setTimeout(function(){
var __flashmsg = $('.flash');
if (__flashmsg.length) {__flashmsg.fadeOut();}
}, 2000);
var msg = 'There was an error editing this issues\'s status.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
}
});
},
Expand All @@ -102,15 +95,8 @@
self.set('labels', response);
},
error: function() {
$('<div></div>', {
'class': 'flash error',
'text': 'There was an error setting labels.'
}).appendTo('body');

setTimeout(function(){
var __flashmsg = $('.flash');
if (__flashmsg.length) {__flashmsg.fadeOut();}
}, 2000);
var msg = 'There was an error setting labels.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
}
});
}
Expand Down

0 comments on commit 21680ef

Please sign in to comment.