Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
graphs positioning fix for manf and chain positioning on resize (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: awjh-ibm <[email protected]>
  • Loading branch information
awjh-ibm authored Mar 14, 2018
1 parent 7437f8f commit e10dae8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ <h5>+ {{ orders.length - 5 }} MORE</h5>
</div>
</div>
</div>
</div>
</div>
<div>
<div class="bc-man-overview">
<h5>
Expand All @@ -142,7 +140,7 @@ <h5>
<button class="btn fade">Weekly</button>
<button class="btn fade">Monthly</button>
</h5>

<div class="graphs">
<img src="/manufacturer/assets/images/Graph 1.svg" alt="Cars Produced">
<img src="/manufacturer/assets/images/Graph 2.svg" alt="Queued Drills">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
width: 100%;
box-sizing: border-box;
margin: 42px 52px;
display: flex;
flex-direction: column;

h1 {
margin: 0 0 60px 0;
display: flex;
justify-content: space-between;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module('bc-vda')

.directive('bcView', [function () {
.directive('bcView', ['$window', function ($window) {
return {
restrict: 'E',
replace: true,
Expand All @@ -25,6 +25,21 @@ angular.module('bc-vda')
padding: 30
};

function debouncer( func , timeout ) {
var timeoutID , timeout = timeout || 200;
return function () {
var scope = this , args = arguments;
clearTimeout( timeoutID );
timeoutID = setTimeout( function () {
func.apply( scope , Array.prototype.slice.call( args ) );
} , timeout );
}
}

angular.element($window).bind('resize', debouncer (function(){
updateChart();
}));

function updateChart() {
// calculate width of chain

Expand Down

0 comments on commit e10dae8

Please sign in to comment.