Permalink
Browse files

Additional save status styling (try to say that 12 times fast)

  • Loading branch information...
1 parent e154730 commit b856ea57d3dd8d504670196b61b6d4f2fe26c9cf @deleted deleted committed Oct 20, 2012
@@ -61,3 +61,9 @@ input#locationSearch {
#new_overlay_view > form > input {
display: block;
}
+
+#saveStatus {
+ vertical-align: middle;
+ margin-left: 0.2em;
+}
+
@@ -146,7 +146,10 @@ $(function($) {
var warpUrl = this.url().replace('.json', '/warp');
model.trigger('before_warp');
saveOptions = {
- error: options.error || function(){},
+ error: function(){
+ if (options.error) options.error();
+ model.trigger('warp_error');
+ },
success: function() {
if (options.success) options.success();
model.trigger('warp_success');
@@ -500,7 +500,7 @@ $(function($) {
'<div id="save-export" class="btn-group">'+
'<button class="btn" id="export">Export</button>'+
'<button class="btn" id="save">Save</button>'+
- '<span id="saveStatus" data-saving-text="Saving..." data-saved-text="Saved."></span>'+
+ '<span id="saveStatus" data-saving-text="Saving..." data-saved-text="Saved." data-save-error="SAVE ERROR!"></span>'+
'</div>'+
'</div>' +
'<div id="split_container">' +
@@ -636,6 +636,8 @@ $(function($) {
saveStatus.text(saveStatus.data('saving-text'));
}).on('warp_success', function(){
saveStatus.text(saveStatus.data('saved-text'));
+ }).on('warp_error', function(){
+ saveStatus.text(saveStatus.data('save-error'));
});
$('button#export').click(function() {

0 comments on commit b856ea5

Please sign in to comment.