Skip to content

Commit

Permalink
sucess notifications after ajax edits (bug 620870)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Dec 29, 2010
1 parent 82b767f commit d6f5745
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 14 additions & 0 deletions media/css/zamboni/developers.css
Expand Up @@ -28,6 +28,20 @@ form .char-count:after {
margin-top: 0;
}

.save-badge {
background: #41B300;
border-radius: 1em;
color: #fff;
font-family: helvetica, arial, sans-serif;
font-size: 10px;
font-style: normal;
font-weight: bold;
margin-left: 0.5em;
padding: 0.375em 1em;
-moz-transition-property: opacity;
-moz-transition-duration: 1s;
}

#version-status .version-changed {
float: right;
color: #888888;
Expand Down
11 changes: 9 additions & 2 deletions media/js/zamboni/devhub.js
Expand Up @@ -127,10 +127,17 @@ function addonFormSubmit() {
(function(parent_div){
$('form', parent_div.not('#edit-addon-media')).submit(function(e){
e.preventDefault();
$.post($(parent_div).find('form').attr('action'),
$.post(parent_div.find('form').attr('action'),
$(this).serialize(), function(d){
$(parent_div).html(d).each(addonFormSubmit);
parent_div.html(d).each(addonFormSubmit);
truncateFields();
var e = $(format('<b class="save-badge">{0}</b>',
[gettext('Changes Saved')]))
.appendTo(parent_div.find('h3').first());
setTimeout(function(){
e.css('opacity', 0);
setTimeout(function(){ e.remove }, 1500);
}, 2000);
});
});
z.refreshL10n();
Expand Down

0 comments on commit d6f5745

Please sign in to comment.