Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b856ea57d3dd8d504670196b61b6d4f2fe26c9cf 1 parent e154730
@deleted deleted authored
View
6 geocamTiePoint/static/geocamTiePoint/css/backbone.css
@@ -61,3 +61,9 @@ input#locationSearch {
#new_overlay_view > form > input {
display: block;
}
+
+#saveStatus {
+ vertical-align: middle;
+ margin-left: 0.2em;
+}
+
View
5 geocamTiePoint/static/geocamTiePoint/js/backbone/models.js
@@ -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');
View
4 geocamTiePoint/static/geocamTiePoint/js/backbone/views.js
@@ -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() {
Please sign in to comment.
Something went wrong with that request. Please try again.