Skip to content

Commit 91ff094

Browse files
committed
Merge remote-tracking branch 'becky/loadingview' into production-readiness
2 parents 8c90be7 + 9fdb699 commit 91ff094

File tree

8 files changed

+113
-91
lines changed

8 files changed

+113
-91
lines changed

app/app-js/modules/loading/loading.controller.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ define(function (require) {
1515
}
1616
},
1717

18-
initialize: function () {
19-
console.log('HERE!');
20-
// this.loadingView = new LoadingView();
21-
// appChannel.commands.execute('showin:loadingRegion', this.loadingView);
22-
},
23-
2418
loadingData: function (modalData) {
19+
this.loadingView = new LoadingView();
20+
appChannel.commands.execute('showin:loadingRegion', this.loadingView);
2521
},
2622

2723
loadedData: function () {
24+
appChannel.commands.execute('close:loadingRegion', this.loadingView);
2825
}
2926
});
3027

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
+30-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
define(function (require) {
2-
// require anything you need
2+
var Marionette = require('marionette'),
3+
template = require('hgn!modules/loading/loading.view'),
4+
Spinner = require('spinner'),
5+
LoadingView;
36

4-
// build the view
5-
6-
return 'The view :)';
7+
LoadingView = Marionette.ItemView.extend({
8+
template: template,
9+
className: 'loading-modal',
10+
11+
onShow: function() {
12+
var opts = {
13+
lines: 10,
14+
length: 12,
15+
width: 8,
16+
radius: 15,
17+
corners: 1,
18+
rotate: 0,
19+
direction: 1,
20+
color: '#007bb6',
21+
speed: 1,
22+
trail: 60,
23+
className: 'spinner'
24+
};
25+
26+
var spinner = new Spinner(opts).spin();
27+
this.$el.append(spinner.el);
28+
}
29+
30+
});
31+
32+
return LoadingView;
733
});

app/app-js/modules/welcome/welcome.view.js

-29
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,6 @@ define(function (require) {
66
StartView = Marionette.ItemView.extend({
77
template: template
88
// className: 'container-fluid'
9-
10-
/*
11-
onShow: function () {
12-
_.defer(function() {
13-
var totalHeight = '100%',
14-
$uriField = $('.js-input-expand');
15-
16-
$uriField.each(function() {
17-
$(this).data('height', $(this).height());
18-
});
19-
20-
$('.js-input-expand')
21-
.focus(function() {
22-
$(this).animate({
23-
height: 100
24-
},
25-
'slow'
26-
);
27-
})
28-
29-
.blur(function() {
30-
$(this).animate({
31-
height: totalHeight
32-
},
33-
'slow'
34-
);
35-
});
36-
});
37-
}*/
389
});
3910

4011
return StartView;

app/less/buttons.less

+47-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,51 @@
22
// Buttons
33
// --------------------------------------------------
44

5-
// Modifications to button danger
6-
@btn-danger-color: @brand-danger;
7-
@btn-danger-bg: #fff;
8-
@btn-danger-border: @brand-danger;
5+
.btn-gray,
6+
.btn-gray-block,
7+
.btn-action,
8+
.btn-action-block,
9+
.btn-green,
10+
.btn-green-block,
11+
.btn-red,
12+
.btn-red-block,
13+
.btn-yellow,
14+
.btn-yellow-block {
15+
&:extend(.btn all, .btn-md all);
16+
}
17+
18+
.btn-gray-block,
19+
.btn-green-block,
20+
.btn-action-block,
21+
.btn-red-block,
22+
.btn-yellow-block {
23+
&:extend(.btn-block all);
24+
}
25+
26+
.btn-gray,
27+
.btn-gray-block {
28+
&:extend(.btn-default all);
29+
}
30+
31+
.btn-action,
32+
.btn-action-block {
33+
&:extend(.btn-primary all);
34+
}
35+
36+
.btn-green,
37+
.btn-green-block {
38+
&:extend(.btn-success all);
39+
}
40+
41+
.btn-red,
42+
.btn-red-block {
43+
&:extend(.btn-danger all);
44+
}
45+
46+
.btn-yellow,
47+
.btn-yellow-block {
48+
&:extend(.btn-warning all);
49+
}
950

1051
// NOTE: This needs to be revised in accordance with engine-ui
1152
.btn-green {
@@ -14,8 +55,9 @@
1455
}
1556

1657
.btn-red {
58+
.button-variant(@brand-danger, #fff, @brand-danger);
1759
&:hover {
1860
color: #fff;
19-
background-color: desaturate(lighten(@brand-danger, 10%), 15%);
61+
background-color: lighten(@brand-danger, 5%);
2062
}
2163
}

app/less/hosted-apis.less

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import "button-groups.less";
33
@import "buttons.less";
44
@import "dashboard.less";
5+
@import "loading.less";
56
@import "mixins.less";
67
@import "static.less";
78
@import "try-uri.less";

app/less/loading.less

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Loading
2+
// --------------------------------------------------
3+
4+
#loading-region {
5+
position: absolute;
6+
top: 0;
7+
width: 100%;
8+
height: 100%;
9+
10+
.loading-modal {
11+
position: relative;
12+
margin: 0 auto;
13+
top: 35%;
14+
width: 100px;
15+
height: 100px;
16+
background: rgba(235, 235, 235, 0.5);
17+
18+
.border-radius (@radius: 10px);
19+
}
20+
}

app/less/mixins.less

+11-47
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,6 @@
1-
// Buttons
1+
// Mixins
22
// --------------------------------------------------
33

4-
.btn-gray,
5-
.btn-gray-block,
6-
.btn-action,
7-
.btn-action-block,
8-
.btn-green,
9-
.btn-green-block,
10-
.btn-red,
11-
.btn-red-block,
12-
.btn-yellow,
13-
.btn-yellow-block {
14-
&:extend(.btn all, .btn-md all);
15-
}
16-
17-
.btn-gray-block,
18-
.btn-green-block,
19-
.btn-action-block,
20-
.btn-red-block,
21-
.btn-yellow-block {
22-
&:extend(.btn-block all);
23-
}
24-
25-
.btn-gray,
26-
.btn-gray-block {
27-
&:extend(.btn-default all);
28-
}
29-
30-
.btn-action,
31-
.btn-action-block {
32-
&:extend(.btn-primary all);
33-
}
34-
35-
.btn-green,
36-
.btn-green-block {
37-
&:extend(.btn-success all);
38-
}
39-
40-
.btn-red,
41-
.btn-red-block {
42-
&:extend(.btn-danger all);
43-
}
44-
45-
.btn-yellow,
46-
.btn-yellow-block {
47-
&:extend(.btn-warning all);
48-
}
49-
504
.border-left-radius(@radius) {
515
border-top-left-radius: @radius;
526
border-bottom-left-radius: @radius;
@@ -64,3 +18,13 @@
6418
-webkit-border-top-right-radius: @radius;
6519
-webkit-border-bottom-right-radius: @radius;
6620
}
21+
22+
.border-radius (@radius: 0px) {
23+
-webkit-border-radius: @radius;
24+
-moz-border-radius: @radius;
25+
border-radius: @radius;
26+
27+
-moz-background-clip: padding;
28+
-webkit-background-clip: padding-box;
29+
background-clip: padding-box;
30+
}

0 commit comments

Comments
 (0)