Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Showing indicator when identity is saved #26

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

0 notes on commit 49b4256

Please sign in to comment.
Something went wrong with that request. Please try again.