Skip to content

Commit f903ee1

Browse files
committed
adds visual confirmation of data-received
1 parent 4ba1d1a commit f903ee1

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Submission for Frontend Engineer
1+
a# Submission for Frontend Engineer
22
This is MEAN Stack app that can be run nightly. It pulls information from an API and caches the information for later display.
33

44
## Configuration
@@ -18,6 +18,8 @@ MongoDB
1818
Nope, Not this time around
1919

2020
## Intructions for local development
21+
Run `npm install` to install dependencies
22+
Run `bower install` to install bower components
2123
Run `grunt` to run tasks and compile assets
2224
Run `grunt server` to view environment on screen
2325

client/app/mainStyles.scss

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,23 @@ nav {
172172
p {
173173
display: inline-block;
174174
margin-top: 1em;
175+
width: 50px;
175176
}
176177

177-
// .postsConfirmation {
178-
// display: inline-block;
179-
// }
178+
.postsConfirmation, .likesConfirmation {
179+
width: 50px;
180+
height: 50px;
181+
margin-left: 10px;
182+
display: inline-block;
183+
background: url('../assets/images/statussprite.png');
184+
background-repeat: none;
185+
background-position: -55px 11px;
186+
}
187+
188+
.postsConfirmation.received, .likesConfirmation.received {
189+
background-position: 6px 9px;
190+
}
180191

181-
// .likesConfirmation {
182-
// display: inline-block;
183-
// }
184192
}
185193

186194
.previousSaves {
1.27 KB
Loading

client/partials/admin.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ <h1>API Administration</h1>
1717
<div class="right adminResponse">
1818
<h3>Data Received</h3>
1919
<!-- Use Sprite with background image to dicatate success sign -->
20-
<p>Posts</p> <div postsConfirmation class="postsConfirmation"></div>
21-
<p>Likes</p> <div likesConfirmation class="likesConfirmation"></div>
20+
<p>Posts</p> <div postsconfirmation class="postsConfirmation"></div>
21+
<br>
22+
<p>Likes</p> <div likesconfirmation class="likesConfirmation"></div>
2223
</div>
2324

2425
<section class="previousSaves">

client/scripts/controllers/AdminCtrl.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,27 @@
172172
elem.addClass('showInline');
173173
});
174174

175+
scope.$on('save-complete', function(){
176+
elem.removeClass('showInline');
177+
});
175178

176179
elem.on('click', function(){
177180
scope.stopTimer();
178181
})
179182
};
180-
});;
183+
})
184+
.directive('postsconfirmation', function($rootScope){
185+
return function(scope, elem) {
186+
$rootScope.$on('posts-data-received', function(){
187+
elem.addClass('received');
188+
})
189+
};
190+
})
191+
.directive('likesconfirmation', function($rootScope){
192+
return function(scope, elem) {
193+
$rootScope.$on('likes-data-received', function(){
194+
elem.addClass('received');
195+
})
196+
};
197+
});
181198
}(window.angular));

0 commit comments

Comments
 (0)