Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.5.1 #206

Merged
merged 4 commits into from
May 27, 2014
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions blank_theme.css → css/blank_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
float: left; }
.dk_container a {
outline: 0; }
.dk_container[disabled] a {
cursor: not-allowed; }

.dk_toggle {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO: Why was this removed? Check into this.

display: -moz-inline-stack;
Expand Down
File renamed without changes.
105 changes: 8 additions & 97 deletions dropkick.css → css/dropkick.css
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.dk_container:focus {
outline: 0; }
.dk_container[disabled] {
opacity:.4; }
opacity: 0.4; }
.dk_container a {
cursor: pointer;
text-decoration: none; }
Expand All @@ -34,10 +34,10 @@
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-transition: border-color .5s;
-moz-transition: border-color .5s;
-o-transition: border-color .5s;
transition: border-color .5s;
-webkit-transition: border-color 0.5s;
-moz-transition: border-color 0.5s;
-o-transition: border-color 0.5s;
transition: border-color 0.5s;
position: relative; }
.dk_toggle:hover, .dk_toggle:focus {
border-color: #8c8c8c; }
Expand Down Expand Up @@ -92,8 +92,7 @@
border-bottom: 1px solid #999;
font-weight: bold;
padding: 8px 10px; }
.dk_options a:hover, .dk_options:focus,
.dk_options .dk_option_current a {
.dk_options a:hover, .dk_options:focus, .dk_options .dk_option_current a {
background-color: #0084c7;
border-bottom-color: #004c72;
color: #fff;
Expand All @@ -103,31 +102,13 @@
border-bottom: none; }
.dk_options .disabled {
cursor: default; }
.dk_options .disabled a,
.dk_options .dk_optgroup.disabled > span {
.dk_options .disabled a {
color: #aaa; }
.dk_options .disabled:hover a,
.dk_options .disabled:focus a {
.dk_options .disabled:hover, .dk_options .disabled:hover a, .dk_options .disabled:focus, .dk_options .disabled:focus a {
cursor: default;
background-color: #fff;
border-bottom-color: #999;
text-shadow: none; }
.dk_options .dk_optgroup {
padding-left: 5px;
background: #ddd;
}
.dk_options .dk_optgroup > span {
display: block;
padding: 5px 10px 5px 5px;
font-style: italic;
color: #444;
background: #ddd;
border-bottom: ;
}
.dk_options .dk_optgroup.disabled,
.dk_options .dk_optgroup.disabled > span {
background: #eee;
}

.dk_options_inner {
max-height: 250px;
Expand Down Expand Up @@ -191,73 +172,3 @@
appearance: none;
-moz-appearance: none;
-webkit-appearance: none; }

/* Here we reflect some of the styles from .dk_container to achieve the same visual also when without javascript */
.dk_wrap {
position: relative;
display: inline-block;
min-width: 173px;
float: left;
margin-right: 10px;
margin-bottom: 18px;
background-color: #f5f5f5;
overflow: hidden;
border: 1px solid #ccc;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-transition: border-color .5s;
-moz-transition: border-color .5s;
-o-transition: border-color .5s;
transition: border-color .5s; }
.dk_wrap:after {
position: absolute;
display: block;
top: 45%;
right: 10px;
content: '';
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #4B4B4B;
pointer-events:none; }
.dk_wrap select {
position: relative;
display: block;
width: 110%;
min-height: 32px;
padding: 6px 49px 6px 6px;
border: 0;
font-family: 'Helvetica', Arial, sans-serif;
font-size: 12px;
font-weight: bold;
line-height: 18px;
color: #333;
text-indent: 0.01px;
text-overflow: '';
text-shadow: #fff 1px 1px 0;
background: transparent;
background: rgba(255,255,255,0);
cursor: pointer;
border-radius: 0;
box-shadow: none;
appearance: none;
-moz-appearance: none;
-webkit-appearance: none; }
.dk_wrap select:focus {
text-shadow: none; }
.dk_wrap select::-ms-expand {
display: none;
}

/* Firefox only */
@-moz-document url-prefix() {
.dk_wrap select { padding: 7px 49px 5px 6px; }
}

/* IE 10 + IE 11 only */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.dk_wrap select { padding: 6px 47px 6px 8px; }
}

/* Opera 12 only */
_:-o-prefocus, body:last-child .dk_wrap select { padding: 7px 45px 5px 10px; }
File renamed without changes.
8 changes: 3 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var rename = require('gulp-rename');

// Lint Task
gulp.task('lint', function() {
return gulp.src('*.js')
return gulp.src('jquery.dropkick.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
Expand All @@ -25,11 +25,9 @@ gulp.task('sass', function() {
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('*.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(rename('jquery.dropkick-min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
.pipe(gulp.dest(''));
});

// Watch Files For Changes
Expand Down
11 changes: 1 addition & 10 deletions jquery.dropkick-min.js
100755 → 100644

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions jquery.dropkick.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DropKick 1.5
* DropKick 1.5.1
*
* Highly customizable <select> lists
* https://github.com/robdel12/DropKick
Expand Down Expand Up @@ -34,7 +34,7 @@
if(!$value.hasClass('disabled') && !$value.closest('.dk_optgroup',$dk).hasClass('disabled')){
if (!$value.hasClass('dk_option_current')) { // Also check if this isn't the selected option
updateFields($option, $dk);
setCurrent($option.parent(), $dk); // IE8+, iOS4 and some Android [4.0] Browsers back to scrollTop 0 when an option is clicked and the dropdown is opened again
setCurrent($option.parent(), $dk); // IE8+, iOS4 and some Android [4.0] Browsers back to scrollTop 0 when an option is clicked and the dropdown is opened again
}
closeDropdown($dk);
}
Expand Down Expand Up @@ -130,15 +130,15 @@
// private
// Update the <select> value, and the dropdown label
updateFields = function(option, $dk, reset) {
var
var
value = option.attr('data-dk-dropdown-value'),
label = option.text(),
data = $dk.data('dropkick'),
$select = data.$select
;

$dk.find('.dk_label').text(!!label?label:'&nbsp;');

!reset ? $select.val(value).trigger('change') : $select.val(value); // Let it act like a normal select when needed

data.settings.change && !reset && !data.settings.syncReverse && data.settings.change.call($select, value, label);
Expand Down Expand Up @@ -325,7 +325,7 @@
if (view.options && view.options.length) {
for (i = 0, l = view.options.length; i < l; i++) {
$option = $(view.options[i]);

if ($option.is('option')) {
oTemplate = (i === 0 && $option.attr('selected') !== undefined && $option.attr('disabled') !== undefined) ? null : buildOption($option);
} else if ($option.is('optgroup')) {
Expand All @@ -339,7 +339,7 @@
oTemplate += '</ul>';
}
oTemplate += '</li>';

}

options[options.length] = oTemplate;
Expand Down Expand Up @@ -430,13 +430,13 @@
// Hide the <select> list and place our new one in front of it
// $dk = $('div[id="dk_container_' + id + '"]').fadeIn(settings.startSpeed);
// To permite cloning methods, will no more need to update the reference to $dk
$select.before($dk).appendTo($dk.addClass('dk_theme_' + theme));
$select.before($dk).appendTo($dk.addClass('dk_theme_' + data.theme));

if ($wrap.length) {
$wrap.removeClass('dk_wrap');
$dk.show();
} else {
$dk.fadeIn(settings.startSpeed)
$dk.fadeIn(settings.startSpeed);
}

// Save the updated $dk reference into our data object
Expand Down Expand Up @@ -539,7 +539,7 @@
$current,
$dkopts
;
// Update data options
// Update data options
data.options = $select.children();
// Rebuild options list. filter options inner and replace
$dkopts = build(dropdownTemplate, data).find('.dk_options_inner');
Expand Down Expand Up @@ -594,7 +594,7 @@
$clone.dropkick(settings);
toReturn[i] = $clone.data('dropkick').$dk[0];
}

});
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DropKick",
"version": "1.5.0",
"version": "1.5.1",
"description": "A jQuery plugin for creating beautiful, graceful, and painless custom dropdowns.",
"main": "jquery.dropkick-min.js",
"directories": {
Expand Down