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

Readme revision #129

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "jq-dropdown",
"version": "0.1.0",
dependencies": {
"jquery": ">=1.10.2"
}
}
48 changes: 17 additions & 31 deletions jquery.dropdown.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.dropdown {
.jq-dropdown {
position: absolute;
z-index: 9999999;
display: none;
}

.dropdown .dropdown-menu,
.dropdown .dropdown-panel {
.jq-dropdown .dropdown-menu,
.jq-dropdown .dropdown-panel {
min-width: 160px;
max-width: 360px;
list-style: none;
Expand All @@ -19,15 +19,15 @@
margin: 0;
}

.dropdown .dropdown-panel {
.jq-dropdown .dropdown-panel {
padding: 10px;
}

.dropdown.dropdown-tip {
.jq-dropdown.dropdown-tip {
margin-top: 8px;
}

.dropdown.dropdown-tip:before {
.jq-dropdown.dropdown-tip:before {
position: absolute;
top: -6px;
left: 9px;
Expand All @@ -39,12 +39,12 @@
display: inline-block;
}

.dropdown.dropdown-tip.dropdown-anchor-right:before {
.jq-dropdown.dropdown-tip.dropdown-anchor-right:before {
left: auto;
right: 9px;
}

.dropdown.dropdown-tip:after {
.jq-dropdown.dropdown-tip:after {
position: absolute;
top: -5px;
left: 10px;
Expand All @@ -55,27 +55,27 @@
display: inline-block;
}

.dropdown.dropdown-tip.dropdown-anchor-right:after {
.jq-dropdown.dropdown-tip.dropdown-anchor-right:after {
left: auto;
right: 10px;
}


.dropdown.dropdown-scroll .dropdown-menu,
.dropdown.dropdown-scroll .dropdown-panel {
.jq-dropdown.dropdown-scroll .dropdown-menu,
.jq-dropdown.dropdown-scroll .dropdown-panel {
max-height: 358px;
overflow: auto;
}

.dropdown .dropdown-menu LI {
.jq-dropdown .dropdown-menu LI {
list-style: none;
padding: 0 0;
margin: 0;
line-height: 18px;
}

.dropdown .dropdown-menu LI > A,
.dropdown .dropdown-menu LABEL {
.jq-dropdown .dropdown-menu LI > A,
.jq-dropdown .dropdown-menu LABEL {
display: block;
color: #555;
text-decoration: none;
Expand All @@ -84,30 +84,16 @@
white-space: nowrap;
}

.dropdown .dropdown-menu LI > A:hover,
.dropdown .dropdown-menu LABEL:hover {
.jq-dropdown .dropdown-menu LI > A:hover,
.jq-dropdown .dropdown-menu LABEL:hover {
background-color: #08C;
color: #FFF;
cursor: pointer;
}

.dropdown .dropdown-menu .dropdown-divider {
.jq-dropdown .dropdown-menu .dropdown-divider {
font-size: 1px;
border-top: solid 1px #E5E5E5;
padding: 0;
margin: 5px 0;
}

/* Icon Examples - icons courtesy of http://p.yusukekamiyamane.com/ */
.dropdown.has-icons LI > A {
padding-left: 30px;
background-position: 8px center;
background-repeat: no-repeat;
}

.dropdown .undo A { background-image: url(icons/arrow-curve-180-left.png); }
.dropdown .redo A { background-image: url(icons/arrow-curve.png); }
.dropdown .cut A { background-image: url(icons/scissors.png); }
.dropdown .copy A { background-image: url(icons/document-copy.png); }
.dropdown .paste A { background-image: url(icons/clipboard.png); }
.dropdown .delete A { background-image: url(icons/cross-script.png); }
16 changes: 8 additions & 8 deletions jquery.dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if (jQuery) (function ($) {
trigger.addClass('dropdown-open');
dropdown
.data('dropdown-trigger', trigger)
.show();
.slideDown();

// Position it
position();
Expand All @@ -76,7 +76,7 @@ if (jQuery) (function ($) {
var targetGroup = event ? $(event.target).parents().addBack() : null;

// Are we clicking anywhere in a dropdown?
if (targetGroup && targetGroup.is('.dropdown')) {
if (targetGroup && targetGroup.is('.jq-dropdown')) {
// Is it a dropdown menu?
if (targetGroup.is('.dropdown-menu')) {
// Did we click on an option? If so close it.
Expand All @@ -88,10 +88,10 @@ if (jQuery) (function ($) {
}

// Hide any dropdown that may be showing
$(document).find('.dropdown:visible').each(function () {
$(document).find('.jq-dropdown:visible').each(function () {
var dropdown = $(this);
dropdown
.hide()
.slideUp()
.removeData('dropdown-trigger')
.trigger('hide', { dropdown: dropdown });
});
Expand All @@ -103,7 +103,7 @@ if (jQuery) (function ($) {

function position() {

var dropdown = $('.dropdown:visible').eq(0),
var dropdown = $('.jq-dropdown:visible').eq(0),
trigger = dropdown.data('dropdown-trigger'),
hOffset = trigger ? parseInt(trigger.attr('data-horizontal-offset') || 0, 10) : null,
vOffset = trigger ? parseInt(trigger.attr('data-vertical-offset') || 0, 10) : null;
Expand All @@ -128,8 +128,8 @@ if (jQuery) (function ($) {
}
}

$(document).on('click.dropdown', '[data-dropdown]', show);
$(document).on('click.dropdown', hide);
$(document).on('click.jq-dropdown', '[data-dropdown]', show);
$(document).on('click.jq-dropdown', hide);
$(window).on('resize', position);

})(jQuery);
})(jQuery);
8 changes: 0 additions & 8 deletions jquery.dropdown.min.js

This file was deleted.

12 changes: 9 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# jQuery Bootstrap-style Dropdowns #
# jQ Bootstrap-style Dropdowns#

Copyright 2013 Cory LaViska for [A Beautiful Site, LLC.](http://abeautifulsite.net/)
This is a fork of Jquery Drop down . The primary disadvantage with Jquery dropdown is that it overrides the bootstrap default dropdowns. Hence if you have used exitsing drop downs in your website all of them will be rendered useless.

I have modified it to not do so. I have also added animations. The long term plan is to make it into an angular directive as well.

The original work is here [A Beautiful Site, LLC.](http://abeautifulsite.net/)

Licensed under the MIT license: http://opensource.org/licenses/MIT

## Demo & Documentation ##

http://labs.abeautifulsite.net/jquery-dropdown/
All the features mentioned here are working in this too. The main change is that it adds a class .jq-dropdown and has animation while showing and hiding the dropdown.

http://labs.abeautifulsite.net/jquery-dropdown/