Skip to content

Commit 231fef8

Browse files
committed
cleanup css; add disabled class for menu
1 parent 4d36f3b commit 231fef8

6 files changed

+24
-54
lines changed

angular-dropdowns.css

+7-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/****** dropdown-select *******/
22

33
.wrap-dd-select {
4-
/* Size and position */
54
position: relative;
65
width: 200px;
76
margin: 0 auto;
@@ -11,24 +10,18 @@
1110
-moz-user-select:none;
1211
user-select:none;
1312

14-
/* Styles */
1513
background: #fff;
1614
border-radius: 7px;
1715
border: 1px solid rgba(0,0,0,0.15);
1816
box-shadow: 0 1px 1px rgba(50,50,50,0.1);
1917
cursor: pointer;
2018
outline: none;
21-
22-
/* Font settings */
2319
font-weight: bold;
2420
color: #8AA8BD;
2521
}
2622

27-
.disabled {
28-
/* Styles */
23+
.wrap-dd-select.disabled {
2924
cursor: default;
30-
31-
/* Font settings */
3225
color: #5B6A7D;
3326
}
3427

@@ -45,28 +38,23 @@
4538
border-color: #8aa8bd transparent;
4639
}
4740

48-
.disabled:after {
41+
.wrap-dd-select.disabled:after {
4942
border: none;
5043
}
5144

5245
.wrap-dd-select .dropdown {
53-
/* Size & position */
5446
position: absolute;
5547
top: 100%;
5648
left: 0;
5749
right: 0;
5850
z-index: 10;
59-
60-
/* Styles */
6151
background: white;
6252
padding: 0;
6353
border-radius: inherit;
6454
border: 1px solid rgba(0,0,0,0.17);
6555
box-shadow: 0 0 5px rgba(0,0,0,0.1);
6656
font-weight: normal;
6757
list-style: none;
68-
69-
/* Hiding */
7058
visibility: hidden;
7159
}
7260

@@ -106,8 +94,6 @@
10694
border: none;
10795
}
10896

109-
/* Hover state */
110-
11197
.wrap-dd-select .dropdown li:hover a {
11298
background: #f3f8f8;
11399
}
@@ -142,31 +128,30 @@
142128

143129
/****** dropdown-menu *******/
144130
.wrap-dd-menu {
145-
/* Size and position */
146131
position: relative;
147132
width: 200px;
148133
margin: 0 auto;
149134
padding: 10px;
150135
}
151136

137+
.wrap-dd-menu.disabled {
138+
cursor: default;
139+
color: #5B6A7D;
140+
}
141+
152142
.wrap-dd-menu .dropdown {
153-
/* Size & position */
154143
position: absolute;
155144
z-index: 1;
156145
top: 70%;
157146
left: 0;
158147
right: 0;
159-
160-
/* Styles */
161148
background: white;
162149
padding: 0;
163150
border-radius: 7px;
164151
border: 1px solid rgba(0,0,0,0.17);
165152
box-shadow: 0 0 5px rgba(0,0,0,0.1);
166153
font-weight: normal;
167154
list-style: none;
168-
169-
/* Hiding */
170155
visibility: hidden;
171156
}
172157

@@ -206,8 +191,6 @@
206191
border: none;
207192
}
208193

209-
/* Hover state */
210-
211194
.wrap-dd-menu .dropdown li:hover a {
212195
background: #f3f8f8;
213196
}

angular-dropdowns.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@
148148
$template.data('$dropdownMenuController', this);
149149

150150
var tpl = $compile($template)($scope);
151-
var $wrap = angular.element('<div class="wrap-dd-menu"></div>');
151+
var $wrap = $compile(angular.element(
152+
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>')
153+
)($scope);
152154

153155
$element.replaceWith($wrap);
154156
$wrap.append($element);
155-
$wrap.append(tpl);
157+
$wrap.append($template);
156158

157159
DropdownService.register(tpl);
158160

dist/angular-dropdowns.css

+7-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/****** dropdown-select *******/
22

33
.wrap-dd-select {
4-
/* Size and position */
54
position: relative;
65
width: 200px;
76
margin: 0 auto;
@@ -11,24 +10,18 @@
1110
-moz-user-select:none;
1211
user-select:none;
1312

14-
/* Styles */
1513
background: #fff;
1614
border-radius: 7px;
1715
border: 1px solid rgba(0,0,0,0.15);
1816
box-shadow: 0 1px 1px rgba(50,50,50,0.1);
1917
cursor: pointer;
2018
outline: none;
21-
22-
/* Font settings */
2319
font-weight: bold;
2420
color: #8AA8BD;
2521
}
2622

27-
.disabled {
28-
/* Styles */
23+
.wrap-dd-select.disabled {
2924
cursor: default;
30-
31-
/* Font settings */
3225
color: #5B6A7D;
3326
}
3427

@@ -45,28 +38,23 @@
4538
border-color: #8aa8bd transparent;
4639
}
4740

48-
.disabled:after {
41+
.wrap-dd-select.disabled:after {
4942
border: none;
5043
}
5144

5245
.wrap-dd-select .dropdown {
53-
/* Size & position */
5446
position: absolute;
5547
top: 100%;
5648
left: 0;
5749
right: 0;
5850
z-index: 10;
59-
60-
/* Styles */
6151
background: white;
6252
padding: 0;
6353
border-radius: inherit;
6454
border: 1px solid rgba(0,0,0,0.17);
6555
box-shadow: 0 0 5px rgba(0,0,0,0.1);
6656
font-weight: normal;
6757
list-style: none;
68-
69-
/* Hiding */
7058
visibility: hidden;
7159
}
7260

@@ -106,8 +94,6 @@
10694
border: none;
10795
}
10896

109-
/* Hover state */
110-
11197
.wrap-dd-select .dropdown li:hover a {
11298
background: #f3f8f8;
11399
}
@@ -142,31 +128,30 @@
142128

143129
/****** dropdown-menu *******/
144130
.wrap-dd-menu {
145-
/* Size and position */
146131
position: relative;
147132
width: 200px;
148133
margin: 0 auto;
149134
padding: 10px;
150135
}
151136

137+
.wrap-dd-menu.disabled {
138+
cursor: default;
139+
color: #5B6A7D;
140+
}
141+
152142
.wrap-dd-menu .dropdown {
153-
/* Size & position */
154143
position: absolute;
155144
z-index: 1;
156145
top: 70%;
157146
left: 0;
158147
right: 0;
159-
160-
/* Styles */
161148
background: white;
162149
padding: 0;
163150
border-radius: 7px;
164151
border: 1px solid rgba(0,0,0,0.17);
165152
box-shadow: 0 0 5px rgba(0,0,0,0.1);
166153
font-weight: normal;
167154
list-style: none;
168-
169-
/* Hiding */
170155
visibility: hidden;
171156
}
172157

@@ -206,8 +191,6 @@
206191
border: none;
207192
}
208193

209-
/* Hover state */
210-
211194
.wrap-dd-menu .dropdown li:hover a {
212195
background: #f3f8f8;
213196
}

dist/angular-dropdowns.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@
148148
$template.data('$dropdownMenuController', this);
149149

150150
var tpl = $compile($template)($scope);
151-
var $wrap = angular.element('<div class="wrap-dd-menu"></div>');
151+
var $wrap = $compile(angular.element(
152+
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>')
153+
)($scope);
152154

153155
$element.replaceWith($wrap);
154156
$wrap.append($element);
155-
$wrap.append(tpl);
157+
$wrap.append($template);
156158

157159
DropdownService.register(tpl);
158160

dist/angular-dropdowns.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-dropdowns.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)