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

Commit e10dae8

Browse files
authored
graphs positioning fix for manf and chain positioning on resize (#121)
Signed-off-by: awjh-ibm <[email protected]>
1 parent 7437f8f commit e10dae8

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

packages/vehicle-manufacture-manufacturing/client/app/views/dashboard/dashboard.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ <h5>+ {{ orders.length - 5 }} MORE</h5>
132132
</div>
133133
</div>
134134
</div>
135-
</div>
136-
</div>
137135
<div>
138136
<div class="bc-man-overview">
139137
<h5>
@@ -142,7 +140,7 @@ <h5>
142140
<button class="btn fade">Weekly</button>
143141
<button class="btn fade">Monthly</button>
144142
</h5>
145-
143+
146144
<div class="graphs">
147145
<img src="/manufacturer/assets/images/Graph 1.svg" alt="Cars Produced">
148146
<img src="/manufacturer/assets/images/Graph 2.svg" alt="Queued Drills">

packages/vehicle-manufacture-manufacturing/client/app/views/dashboard/dashboard.less

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
width: 100%;
55
box-sizing: border-box;
66
margin: 42px 52px;
7+
display: flex;
8+
flex-direction: column;
79

810
h1 {
9-
margin: 0 0 60px 0;
1011
display: flex;
1112
justify-content: space-between;
1213

packages/vehicle-manufacture-vda/client/app/directives/blockchain-view/blockchain-view.directive.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
angular.module('bc-vda')
22

3-
.directive('bcView', [function () {
3+
.directive('bcView', ['$window', function ($window) {
44
return {
55
restrict: 'E',
66
replace: true,
@@ -25,6 +25,21 @@ angular.module('bc-vda')
2525
padding: 30
2626
};
2727

28+
function debouncer( func , timeout ) {
29+
var timeoutID , timeout = timeout || 200;
30+
return function () {
31+
var scope = this , args = arguments;
32+
clearTimeout( timeoutID );
33+
timeoutID = setTimeout( function () {
34+
func.apply( scope , Array.prototype.slice.call( args ) );
35+
} , timeout );
36+
}
37+
}
38+
39+
angular.element($window).bind('resize', debouncer (function(){
40+
updateChart();
41+
}));
42+
2843
function updateChart() {
2944
// calculate width of chain
3045

0 commit comments

Comments
 (0)