Skip to content

Commit

Permalink
Fixes theme and refresh methods + progressive enhancement
Browse files Browse the repository at this point in the history
- Fixes the theme and refresh methods to work both if <select> or
dk_container are called
-  Bring back filter gradients for themes in IE < 8
  • Loading branch information
acemir committed Sep 2, 2013
1 parent d6167bd commit 6c3f8d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
26 changes: 22 additions & 4 deletions example/example.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ul {

.example {
background-color: #f9f4ea;
background-color: rgba(255, 255, 255, .5);

border-bottom: 1px solid #ccc;
margin-bottom: 20px;
padding: 18px;
Expand Down Expand Up @@ -162,8 +162,13 @@ h1 span {
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
/*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 );*/ /* IE6-9 */ /* Avoid filter! It breaks IE<8 */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
background-color: #f1f1f1 \9; /* IE < 8 */
}
.dk_theme_orange .dk_toggle {
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#e1e1e1',GradientType=0)\9; /* IE < 8 */
}
.dk_theme_orange .dk_label {
display: block\9; /* IE < 8 */
}
.dk_theme_orange .dk_options a:hover,
.dk_theme_orange .dk_option_current a {
background-color: #E15A01;
Expand Down Expand Up @@ -192,8 +197,13 @@ h1 span {
background: -ms-linear-gradient(top, #aebcbf 0%,#6e7774 50%,#0a0e0a 51%,#0a0809 100%); /* IE10+ */
/*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aebcbf', endColorstr='#0a0809',GradientType=0 );*/ /* IE6-9 */ /* Avoid filter! It breaks IE<8 */
background: linear-gradient(to bottom, #aebcbf 0%,#6e7774 50%,#0a0e0a 51%,#0a0809 100%); /* W3C */
background-color: #6e7774 \9; /* Old browsers */
}
.dk_theme_black .dk_toggle {
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#aebcbf',endColorstr='#0a0809',GradientType=0)\9; /* IE < 8 */
}
.dk_theme_black .dk_label {
display: block\9; /* IE < 8 */
}
.dk_theme_black .dk_toggle,
.dk_theme_black.dk_open .dk_toggle {
background-color: transparent;
Expand All @@ -213,4 +223,12 @@ h1 span {
background-color: #E15A01;
color: #fff;
text-shadow: #604A42 0 1px 0;
}
}

/* Cancel Filter for IE9, that supports svg background */
@media all and (min-width:0) {
.dk_theme_orange .dk_toggle,
.dk_theme_black .dk_toggle {
filter: none \0/;
}
}
7 changes: 3 additions & 4 deletions jquery.dropkick.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@
// Allows dynamic theme changes
methods.theme = function (newTheme) {
var
$select = $(this),
data = $select.data('dropkick'),
data = $(this).data('dropkick'),
$dk = data.$dk,
oldtheme = 'dk_theme_' + data.theme
;
Expand Down Expand Up @@ -461,8 +460,8 @@
methods.refresh = function(){
return this.each(function () {
var
$select = $(this),
data = $select.data('dropkick'),
data = $(this).data('dropkick'),
$select = data.$select,
$dk = data.$dk
;

Expand Down

0 comments on commit 6c3f8d0

Please sign in to comment.