Skip to content

Commit

Permalink
Rebuilds files
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed May 9, 2014
1 parent fc7ff3a commit 31e46b7
Show file tree
Hide file tree
Showing 104 changed files with 1,045 additions and 123 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module.exports = function(grunt) {
'test/**/*.js',
'src/**/*.js'
],
tasks : testWatchTasks
tasks : watchTasks
},
src: {
files: [
Expand Down
6 changes: 4 additions & 2 deletions build/less/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
}
.ui.form .fields.error .field .ui.dropdown .menu .item:hover,
.ui.form .field.error .ui.dropdown .menu .item:hover {
.ui.form .fields.error .field .ui.selection.dropdown .menu .item:hover,
.ui.form .fields.error .field .ui.selection.dropdown .menu .item.hovered
.ui.form .field.error .ui.selection.dropdown .menu .item:hover,
.ui.form .field.error .ui.selection.dropdown .menu .item.hovered{
background-color: #FFF2F2;
}

Expand Down
85 changes: 84 additions & 1 deletion build/less/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ $.fn.dropdown = function(parameters) {
module.bind.touchEvents();
}
module.bind.mouseEvents();
module.bind.keyboardEvents();
module.instantiate();
},

Expand All @@ -91,6 +92,88 @@ $.fn.dropdown = function(parameters) {
},

bind: {
keyboardEvents: function() {
module.debug('Binding keyboard events');

var
keycodes = {
Enter: 13,
UpArrow: 38,
DownArrow: 40
},
itemIndex = -1
;

var selectItem = function selectItem(item) {
item
.addClass("hovered")
.mouseenter()
;
};
var deselectItem = function deselectItem(item) {
item
.removeClass("hovered")
.mouseleave()
;
};

$module
.on('keydown' + eventNamespace, function (e) {
// Reevaluate selector to deal with dynamic items
$item = $module.find(selector.item);
var notSelected = itemIndex === -1;
// Determine selected item
if (notSelected && $text.text()) {
$item.each(function (collectionIndex, value) {
if ($(value).data(metadata.text) == $text.text()) {
itemIndex = collectionIndex;
}
});
}

if (e.which == keycodes.Enter) {
if (module.is.hidden()) {
module.show();
} else {
notSelected ? module.hide() : $($item[itemIndex]).click();
}
} else if (e.which == keycodes.DownArrow) {
if (itemIndex < $item.length - 1) {
if (itemIndex > -1) {
deselectItem($($item[itemIndex]));
}
itemIndex++;
selectItem($($item[itemIndex]));
}
} else if (e.which == keycodes.UpArrow) {
if (itemIndex > 0 ) {
if (itemIndex <= $item.length - 1 ) {
deselectItem($($item[itemIndex]));
}
itemIndex--;
selectItem($($item[itemIndex]));
}
} else {
var characterToFind = String.fromCharCode(e.which);
for (var collectionIndex = 0; collectionIndex < $item.length; collectionIndex ++) {
var value = $item[collectionIndex];
var itemValue = $(value).text();

if (itemValue && itemValue.charAt(0).toLowerCase() === characterToFind.toLowerCase()) {
if (collectionIndex > itemIndex ||
$($item[itemIndex]).text().charAt(0).toLowerCase() !== characterToFind.toLowerCase() ) {
console.log(itemValue);
deselectItem($($item[itemIndex]));
itemIndex = collectionIndex;
selectItem($($item[itemIndex]));
break;
}
}
}
}
})
;
},
touchEvents: function() {
module.debug('Touch device detected binding touch events');
$module
Expand Down Expand Up @@ -925,7 +1008,7 @@ $.fn.dropdown.settings = {
$.extend( $.easing, {
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
}
});


Expand Down
53 changes: 52 additions & 1 deletion build/less/modules/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
----------------------*/

/* Menu Item Hover */
.ui.dropdown .menu .item:hover {
.ui.dropdown .menu .item:hover,
.ui.dropdown .menu .item.hovered {
background-color: rgba(0, 0, 0, 0.02);
z-index: 12;
}
Expand Down Expand Up @@ -385,6 +386,56 @@
margin-right: 0.5em;
}

/*--------------------
Error
----------------------*/
.ui.selection.dropdown.error,
.ui.selection.dropdown.error .item {
background-color: #FFFAFA;
color: #D95C5C;
}
.ui.selection.dropdown.error {
-webkit-box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
}

.ui.selection.dropdown.error .menu {
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
border-radius: 0px 0px 0.325em 0.325em;
}


/* Menu Item Active */
.ui.selection.dropdown.error .menu .active.item {
background-color: #FDCFCF !important;
}

/* Hover */
.ui.selection.dropdown:hover {
-webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.2) !important;
box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.2) !important;
}
.ui.selection.dropdown:hover .menu {
-webkit-box-shadow: 0px 1px 0px 1px #D3D3D3;
box-shadow: 0px 1px 0px 1px #D3D3D3;
}
.ui.selection.dropdown:hover > .dropdown.icon {
opacity: 1;
}
.ui.selection.dropdown.error:hover {
-webkit-box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
}
.ui.selection.dropdown.error:hover .menu {
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
}
.ui.selection.dropdown.error .menu .item:hover,
.ui.selection.dropdown.error .menu .item.hovered{
background-color: #FFF2F2;
}

/* Visible */
.ui.visible.selection.dropdown {
border-bottom-left-radius: 0em !important;
Expand Down
2 changes: 1 addition & 1 deletion build/minified/collections/breadcrumb.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: 04/22/2014
* Released: 05/09/2014
*/

.ui.breadcrumb{margin:1em 0;display:inline-block;vertical-align:middle}.ui.breadcrumb:first-child{margin-top:0}.ui.breadcrumb:last-child{margin-bottom:0}.ui.breadcrumb .divider{display:inline-block;opacity:.5;margin:0 .15em;font-size:1em;color:rgba(0,0,0,.3)}.ui.breadcrumb a.section{cursor:pointer}.ui.breadcrumb .section{display:inline-block;margin:0;padding:0}.ui.breadcrumb.segment{display:inline-block;padding:.5em 1em}.ui.breadcrumb .active.section{font-weight:700}.ui.small.breadcrumb{font-size:.75em}.ui.large.breadcrumb{font-size:1.1em}.ui.huge.breadcrumb{font-size:1.3em}
4 changes: 2 additions & 2 deletions build/minified/collections/form.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 31e46b7

Please sign in to comment.