Permalink
Browse files

Adding some visual notifications that the relationships need to be sa…

…ved when modified.
  • Loading branch information...
jkeck committed Nov 15, 2011
1 parent b737876 commit 3972e9aaf20662dc6df78984c1cc769e12c1e54e
Showing with 9 additions and 0 deletions.
  1. +8 −0 public/javascripts/relationships.js
  2. +1 −0 public/stylesheets/hypatia.css
@@ -5,6 +5,8 @@ $(document).ready(function() {
revert: false,
revertDuration: false,
update: function(event, ui) {
+ // Add unsaved class so the user knows that they need to save.
+ $("#relationship-editor .member-pane").addClass("unsaved");
// Ensure that all items have a "remove" link
$('.remove-relationship').remove();
var members = $("#member-list li");
@@ -25,6 +27,10 @@ $(document).ready(function() {
});
$.ajax({
url: $(this).attr("data-update-path") + "?" + pids.join("&"),
+ success: function() {
+ // remove the unsaved class so the user knows that the relationships were properly saved.
+ $("#relationship-editor .member-pane").removeClass("unsaved");
+ },
error: function() {
alert("Error");
}
@@ -34,6 +40,8 @@ $(document).ready(function() {
// Moves item back to list of origin when removed
// or just delete it if it started in member list
$(".remove-relationship").live('click', function() {
+ // Add unsaved class so the user knows that they need to save.
+ $("#relationship-editor .member-pane").addClass("unsaved");
var removed = $(this).parent();
removed.fadeOut('300', function(){
removed.children('.remove-relationship').remove();
@@ -666,6 +666,7 @@ img.lb-img {
-moz-border-radius: 12px;
border-radius: 12px; }
.relationship-pane .list-title {text-align: center; }
+#relationship-editor .unsaved {border: 2px solid #990000;}
.relationship-pane ul {margin: 8px 0; position: relative;}
.relationship-pane li {background: #EEE; border: 1px solid #aaa; color: #222; cursor: move; font-size: 14px; line-height: 1.2em; list-style: none; margin: 10px 0; padding: 10px; text-decoration: none;
background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgba(88,88,88, 0.2)), color-stop(1, rgba(88,88,88,0)) );

0 comments on commit 3972e9a

Please sign in to comment.