Permalink
Browse files

Showing indicator when identity is saved #26

  • Loading branch information...
1 parent 2d80a37 commit 49b42560909179d8bc31b01be9a100c4f84708e2 @mwl mwl committed Sep 12, 2012
@@ -8,4 +8,25 @@
.treeexpander {
padding-right: 3px;
+}
+div.savedindicator {
+ text-align: center;
+ position: fixed;
+ top: -27px;
+ width: 200px;
+ left: 50%;
+ margin-left: -100px;
+ background-color: #dff0d8;
+ padding: 3px 10px 3px 10px;
+ border: 1px gray solid;
+ border-top: 0px;
+ border-bottom-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+
+div.savedindicator.animation {
+ -webkit-transition: top 1s linear;
+}
+div.savedindicator.active {
+ top: 0px;
}
@@ -11,6 +11,7 @@
<title>Cave register</title>
</head>
<body>
+<div class="savedindicator animation"><i class="icon-ok"></i>&nbsp;Gemt!</div>
<div class="container-fluid" ng-controller="IdentityCtrl">
<div class="navbar">
<div class="navbar-inner">
@@ -19,6 +20,8 @@
</form>
</div>
</div>
+
+
<div class="alert fade in" ng-init="dirty=false" ng-show="dirty">
<p>Er ikke gemt</p>
@@ -11,15 +11,18 @@ var treeHtml = "<span>" +
"</li>" +
"</ul>"
-module.controller("IdentityCtrl", function($scope, $location, $log, $http) {
+module.controller("IdentityCtrl", function($scope, $location, $log, $http, $timeout) {
$scope.findIdentity = function() {
$http.get("/identities/" + $scope.identityCpr).success(function(data, status) {
$scope.identity = data;
})
}
$scope.saveIdentity = function() {
$http.put("/identities/" + $scope.identity.cpr, $scope.identity).success(function(data, status) {
- //TODO: show identity is saved
+ $(".savedindicator").addClass("active")
+ $timeout(function () {
+ $(".savedindicator").removeClass("active")
+ }, 5000);
})
}

0 comments on commit 49b4256

Please sign in to comment.