diff --git a/assets/javascripts/backlog.js b/assets/javascripts/backlog.js index 0d957f5526..f2323c4998 100644 --- a/assets/javascripts/backlog.js +++ b/assets/javascripts/backlog.js @@ -47,6 +47,8 @@ RB.Backlog = Object.create(RB.Model, { type: "POST", url: RB.urlFor['reorder'], data: stories + moveto + dropped, + beforeSend: function(xhr){ ui.item.data('this').markSaving() }, + complete: function(xhr, textStatus){ ui.item.data('this').unmarkSaving() } }); }, diff --git a/assets/javascripts/story.js b/assets/javascripts/story.js index a1c41764df..b6465ae12b 100644 --- a/assets/javascripts/story.js +++ b/assets/javascripts/story.js @@ -70,6 +70,10 @@ RB.Story = Object.create(RB.Model, { } }, + markSaving: function(){ + this.$.addClass('saving'); + }, + saveEdits: function(){ j = this.$; editors = j.find('.editor'); @@ -106,6 +110,10 @@ RB.Story = Object.create(RB.Model, { // Focus on the input corresponding to the field clicked j.find( '.' + $(event.currentTarget).attr('fieldname') + '.editor' ).focus(); } + }, + + unmarkSaving: function(){ + this.$.removeClass('saving'); } }); \ No newline at end of file diff --git a/assets/stylesheets/story.css b/assets/stylesheets/story.css index 1dd5d66201..bc927c8b78 100644 --- a/assets/stylesheets/story.css +++ b/assets/stylesheets/story.css @@ -34,6 +34,19 @@ position:absolute; top:7px; } +.story.saving .checkbox{ + display:none; +} +.story.saving .spinner, +.story.updating .spinner{ + background-image:url('../images/indicator.gif'); + display:block; + height:16px; + left:9px; + position:absolute; + top:6px; + width:16px; +} .story .id{ background-color:#cfc; display:block;