Skip to content

Commit affd70d

Browse files
committed
Region selector: Add buttons, more styling, placeholder functionality
1 parent fb44e6d commit affd70d

2 files changed

Lines changed: 100 additions & 14 deletions

File tree

ui/css/cloudstack3.css

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11103,9 +11103,8 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1110311103
-khtml-border-radius: 4px;
1110411104
border-radius: 4px;
1110511105
width: 281px;
11106-
background: #FFFFFF;
11107-
min-height: 275px;
11108-
max-height: 275px;
11106+
background: #E4E4E4;
11107+
height: 327px;
1110911108
/*+placement:shift 72px 49px;*/
1111011109
position: relative;
1111111110
left: 72px;
@@ -11119,14 +11118,65 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1111911118
box-shadow: 0px 3px 11px #171717;
1112011119
}
1112111120

11121+
.region-selector h2 {
11122+
color: #283139;
11123+
text-shadow: 0px 1px 3px #FFFFFF;
11124+
margin: 5px 0 12px;
11125+
text-align: center;
11126+
letter-spacing: 1px;
11127+
font-size: 18px;
11128+
}
11129+
11130+
.region-selector .buttons {
11131+
width: 95%;
11132+
height: 33px;
11133+
margin: 5px auto 0;
11134+
}
11135+
11136+
.region-selector .buttons .button.close {
11137+
float: right;
11138+
cursor: pointer;
11139+
background: url(../images/bg-gradients.png) 0px -270px;
11140+
/*+border-radius:4px;*/
11141+
-moz-border-radius: 4px;
11142+
-webkit-border-radius: 4px;
11143+
-khtml-border-radius: 4px;
11144+
border-radius: 4px;
11145+
border: 1px solid #B1B1B1;
11146+
padding: 8px 17px 8px 18px;
11147+
}
11148+
11149+
.region-selector .buttons .button.close:hover {
11150+
/*+box-shadow:inset 0px 2px 4px #525252;*/
11151+
-moz-box-shadow: inset 0px 2px 4px #525252;
11152+
-webkit-box-shadow: inset 0px 2px 4px #525252;
11153+
-o-box-shadow: inset 0px 2px 4px #525252;
11154+
box-shadow: inset 0px 2px 4px #525252;
11155+
}
11156+
11157+
.region-selector .buttons .button.close span {
11158+
color: #636363;
11159+
/*+text-shadow:none;*/
11160+
-moz-text-shadow: none;
11161+
-webkit-text-shadow: none;
11162+
-o-text-shadow: none;
11163+
text-shadow: none;
11164+
}
11165+
11166+
.region-selector .buttons .button.close:hover span {
11167+
color: #000000;
11168+
}
11169+
1112211170
.region-selector ul {
11123-
width: 97%;
11171+
background: #FFFFFF;
11172+
width: 94%;
1112411173
/*+border-radius:4px;*/
1112511174
-moz-border-radius: 4px;
1112611175
-webkit-border-radius: 4px;
1112711176
-khtml-border-radius: 4px;
1112811177
border-radius: 4px;
11129-
height: 253px;
11178+
height: 237px;
11179+
border: 1px solid #B7B7B7;
1113011180
overflow: auto;
1113111181
margin: auto;
1113211182
/*+box-shadow:inset 0px 0px 8px #A3A3A3;*/
@@ -11138,22 +11188,23 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1113811188

1113911189
.region-selector ul li {
1114011190
background: none;
11141-
color: #3E4B56;
11142-
font-size: 14px;
11191+
color: #415C72;
11192+
font-size: 13px;
1114311193
/*+text-shadow:none;*/
1114411194
-moz-text-shadow: none;
1114511195
-webkit-text-shadow: none;
1114611196
-o-text-shadow: none;
1114711197
text-shadow: none;
1114811198
text-indent: 14px;
1114911199
cursor: pointer;
11150-
border-bottom: 1px solid #C9C5C5;
11200+
border-bottom: 1px solid #CACACA;
1115111201
width: 100%;
11152-
padding: 18px 0;
11202+
padding: 15px 0;
1115311203
}
1115411204

11155-
.region-selector ul li:hover {
11156-
background: #E9E9E9;
11205+
.region-selector ul li:hover,
11206+
.region-selector ul li.active {
11207+
background: #E9E9E9 url(../images/bg-gradients.png) repeat-x 0px -31px;
1115711208
/*+text-shadow:0px 1px #FFFFFF;*/
1115811209
-moz-text-shadow: 0px 1px #FFFFFF;
1115911210
-webkit-text-shadow: 0px 1px #FFFFFF;

ui/scripts/ui/core.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,61 @@
141141

142142
var $regionSelector = $('<div>').addClass('region-selector')
143143
.append($('<div>').addClass('top-arrow'))
144+
.append($('<h2>').html(_l('label.menu.regions')))
144145
.append($regionList)
146+
.append(
147+
$('<div>').addClass('buttons')
148+
.append(
149+
$('<div>').addClass('button close').append($('<span>').html(_l('label.close')))
150+
)
151+
)
145152
.hide();
146153
var $regionSwitcherButton = $('<div>').addClass('region-switcher')
147154
.attr('title', 'Select region')
148155
.append(
149156
$('<span>').addClass('icon').html('&nbsp;')
150157
);
151158

159+
var closeRegionSelector = function(args) {
160+
$regionSwitcherButton.removeClass('active');
161+
$regionSelector.fadeOut(args ? args.complete : null);
162+
$('body > .overlay').fadeOut(function() { $('body > .overlay').remove() });
163+
};
164+
165+
var switchRegion = function(url) {
166+
closeRegionSelector({
167+
complete: function() {
168+
$('#container').prepend($('<div>').addClass('loading-overlay'));
169+
170+
document.location.href = url;
171+
}
172+
});
173+
};
174+
175+
$regionList.click(function(event) {
176+
var $target = $(event.target);
177+
var $li = $target.closest('li');
178+
179+
if ($li.size()) {
180+
var url = 'http://10.223.77.3:8080/client';
181+
182+
switchRegion(url);
183+
}
184+
});
152185

153186
$regionSwitcherButton.click(function() {
154187
if ($regionSwitcherButton.hasClass('active')) {
155-
$regionSwitcherButton.removeClass('active');
156-
$regionSelector.fadeOut();
157-
$('body > .overlay').remove();
188+
closeRegionSelector();
158189
} else {
159190
$regionSwitcherButton.addClass('active');
160191
$regionSelector.fadeIn('fast').overlay();
161192
}
162193
});
163194

195+
$regionSelector.find('.button.close').click(function() {
196+
closeRegionSelector();
197+
});
198+
164199
// Project switcher
165200
var $viewSwitcher = $('<div>').addClass('button view-switcher')
166201
.append(

0 commit comments

Comments
 (0)