Skip to content

Commit

Permalink
Rebuild 2.2.11 for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jul 11, 2017
1 parent f584e12 commit 7e37d4a
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 187 deletions.
30 changes: 16 additions & 14 deletions dist/components/dropdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -971,23 +971,25 @@ select.ui.dropdown {
.ui.dropdown .menu .left.menu {
left: auto;
right: 100%;
margin: 0em -0.5em 0em 0em !important;
border-radius: 0.28571429rem !important;
}
.ui.dropdown .item .left.dropdown.icon,
.ui.dropdown .left.menu .item .dropdown.icon {
width: auto;
float: left;
margin: 0em 0.78571429rem 0em 0em;
margin: 0em 0em 0em 0em;
}
.ui.dropdown .item .left.dropdown.icon,
.ui.dropdown .left.menu .item .dropdown.icon {
width: auto;
float: left;
margin: 0em 0.78571429rem 0em 0em;
margin: 0em 0em 0em 0em;
}
.ui.dropdown .item .left.dropdown.icon + .text,
.ui.dropdown .left.menu .item .dropdown.icon + .text {
margin-left: 1em;
margin-right: 0em;
}

/*--------------
Expand Down Expand Up @@ -1225,7 +1227,7 @@ select.ui.dropdown {
transform: rotate(45deg);
width: 0.5em;
height: 0.5em;
box-shadow: -1px -1px 0px 1px rgba(34, 36, 38, 0.15);
box-shadow: -1px -1px 0px 0px rgba(34, 36, 38, 0.15);
background: #FFFFFF;
z-index: 2;
}
Expand Down Expand Up @@ -1365,45 +1367,45 @@ select.ui.dropdown {
}

/* Upward pointing */
.ui.pointing.dropdown > .upward.menu,
.ui.top.pointing.dropdown > .upward.menu {
.ui.pointing.upward.dropdown .menu,
.ui.top.pointing.upward.dropdown .menu {
top: auto !important;
bottom: 100% !important;
margin: 0em 0em 0.78571429rem;
border-radius: 0.28571429rem;
}
.ui.pointing.dropdown > .upward.menu:after,
.ui.top.pointing.dropdown > .upward.menu:after {
.ui.pointing.upward.dropdown .menu:after,
.ui.top.pointing.upward.dropdown .menu:after {
top: 100% !important;
bottom: auto !important;
box-shadow: 1px 1px 0px 1px rgba(34, 36, 38, 0.15);
box-shadow: 1px 1px 0px 0px rgba(34, 36, 38, 0.15);
margin: -0.25em 0em 0em;
}

/* Right Pointing Upward */
.ui.right.pointing.dropdown:not(.top):not(.bottom) > .upward.menu {
.ui.right.pointing.upward.dropdown:not(.top):not(.bottom) .menu {
top: auto !important;
bottom: 0 !important;
margin: 0em 1em 0em 0em;
}
.ui.right.pointing.dropdown:not(.top):not(.bottom) > .upward.menu:after {
.ui.right.pointing.upward.dropdown:not(.top):not(.bottom) .menu:after {
top: auto !important;
bottom: 0 !important;
margin: 0em 0em 1em 0em;
box-shadow: -1px -1px 0px 1px rgba(34, 36, 38, 0.15);
box-shadow: -1px -1px 0px 0px rgba(34, 36, 38, 0.15);
}

/* Left Pointing Upward */
.ui.left.pointing.dropdown:not(.top):not(.bottom) > .upward.menu {
.ui.left.pointing.upward.dropdown:not(.top):not(.bottom) .menu {
top: auto !important;
bottom: 0 !important;
margin: 0em 0em 0em 1em;
}
.ui.left.pointing.dropdown:not(.top):not(.bottom) > .upward.menu:after {
.ui.left.pointing.upward.dropdown:not(.top):not(.bottom) .menu:after {
top: auto !important;
bottom: 0 !important;
margin: 0em 0em 1em 0em;
box-shadow: -1px -1px 0px 1px rgba(34, 36, 38, 0.15);
box-shadow: -1px -1px 0px 0px rgba(34, 36, 38, 0.15);
}


Expand Down
163 changes: 89 additions & 74 deletions dist/components/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2368,29 +2368,29 @@ $.fn.dropdown = function(parameters) {
},
direction: function($menu) {
if(settings.direction == 'auto') {
if(module.is.onScreen($menu)) {
// reset position
module.remove.upward();

if(module.can.openDownward($menu)) {
module.remove.upward($menu);
}
else {
module.set.upward($menu);
}
if(!module.is.leftward($menu) && !module.can.openRightward($menu)) {
module.set.leftward($menu);
}
}
else if(settings.direction == 'upward') {
module.set.upward($menu);
}
if(module.can.openRightward($menu)) {
module.remove.leftward($menu);
}
else {
module.set.leftward($menu);
}
},
upward: function($menu) {
var $element = $menu || $module;
upward: function($currentMenu) {
var $element = $currentMenu || $module;
$element.addClass(className.upward);
},
leftward: function($menu) {
var $element = $menu || $module;
leftward: function($currentMenu) {
var $element = $currentMenu || $menu;
$element.addClass(className.leftward);
},
value: function(value, text, $selected) {
Expand Down Expand Up @@ -2740,12 +2740,12 @@ $.fn.dropdown = function(parameters) {
initialLoad: function() {
initialLoad = false;
},
upward: function($menu) {
var $element = $menu || $module;
upward: function($currentMenu) {
var $element = $currentMenu || $module;
$element.removeClass(className.upward);
},
leftward: function($menu) {
var $element = $menu || $module;
leftward: function($currentMenu) {
var $element = $currentMenu || $menu;
$element.removeClass(className.leftward);
},
visible: function() {
Expand Down Expand Up @@ -3052,6 +3052,10 @@ $.fn.dropdown = function(parameters) {
: $menu.transition && $menu.transition('is animating')
;
},
leftward: function($subMenu) {
var $selectedMenu = $subMenu || $menu;
return $selectedMenu.hasClass(className.leftward);
},
disabled: function() {
return $module.hasClass(className.disabled);
},
Expand All @@ -3070,46 +3074,6 @@ $.fn.dropdown = function(parameters) {
initialLoad: function() {
return initialLoad;
},
onScreen: function($subMenu) {
var
$currentMenu = $subMenu || $menu,
canOpenDownward = true,
onScreen = {},
calculations
;
$currentMenu.addClass(className.loading);
calculations = {
context: {
scrollTop : $context.scrollTop(),
height : $context.outerHeight()
},
menu : {
offset: $currentMenu.offset(),
height: $currentMenu.outerHeight()
}
};
if(module.is.verticallyScrollableContext()) {
calculations.menu.offset.top += calculations.context.scrollTop;
}
onScreen = {
above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height,
below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height
};
if(onScreen.below) {
module.verbose('Dropdown can fit in context downward', onScreen);
canOpenDownward = true;
}
else if(!onScreen.below && !onScreen.above) {
module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);
canOpenDownward = true;
}
else {
module.verbose('Dropdown cannot fit below, opening upward', onScreen);
canOpenDownward = false;
}
$currentMenu.removeClass(className.loading);
return canOpenDownward;
},
inObject: function(needle, object) {
var
found = false
Expand Down Expand Up @@ -3172,6 +3136,14 @@ $.fn.dropdown = function(parameters) {
: false
;
return (overflowY == 'auto' || overflowY == 'scroll');
},
horizontallyScrollableContext: function() {
var
overflowX = ($context.get(0) !== window)
? $context.css('overflow-X')
: false
;
return (overflowX == 'auto' || overflowX == 'scroll');
}
},

Expand All @@ -3188,26 +3160,77 @@ $.fn.dropdown = function(parameters) {
}
return false;
},
openRightward: function($menu) {
openDownward: function($subMenu) {
var
$currentMenu = $subMenu || $menu,
canOpenDownward = true,
onScreen = {},
calculations
;
$currentMenu
.addClass(className.loading)
;
calculations = {
context: {
scrollTop : $context.scrollTop(),
height : $context.outerHeight()
},
menu : {
offset: $currentMenu.offset(),
height: $currentMenu.outerHeight()
}
};
if(module.is.verticallyScrollableContext()) {
calculations.menu.offset.top += calculations.context.scrollTop;
}
onScreen = {
above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height,
below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height
};
if(onScreen.below) {
module.verbose('Dropdown can fit in context downward', onScreen);
canOpenDownward = true;
}
else if(!onScreen.below && !onScreen.above) {
module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);
canOpenDownward = true;
}
else {
module.verbose('Dropdown cannot fit below, opening upward', onScreen);
canOpenDownward = false;
}
$currentMenu.removeClass(className.loading);
return canOpenDownward;
},
openRightward: function($subMenu) {
var
$currentMenu = $subMenu || $menu,
canOpenRightward = true,
isOutsideScreen = false,
isOffscreenRight = false,
calculations
;
$menu
$currentMenu
.addClass(className.loading)
;
calculations = {
contextWidth : $context.outerWidth(),
menuOffset : $menu.offset().left,
menuWidth : $menu.outerWidth(),
context: {
scrollLeft : $context.scrollLeft(),
width : $context.outerWidth()
},
menu: {
offset : $currentMenu.offset(),
width : $currentMenu.outerWidth()
}
};
isOutsideScreen = (calculations.menuOffset + calculations.menuWidth > calculations.contextWidth) || (calculations.menuOffset - $menu.offset().left < 0);
if(isOutsideScreen) {
module.verbose('Dropdown cannot fit in context rightward', isOutsideScreen);
if(module.is.horizontallyScrollableContext()) {
calculations.menu.offset.left += calculations.context.scrollLeft;
}
isOffscreenRight = (calculations.menu.offset.left + calculations.menu.width >= calculations.context.scrollLeft + calculations.context.width);
if(isOffscreenRight) {
module.verbose('Dropdown cannot fit in context rightward', isOffscreenRight);
canOpenRightward = false;
}
$menu.removeClass(className.loading);
$currentMenu.removeClass(className.loading);
return canOpenRightward;
},
click: function() {
Expand Down Expand Up @@ -3242,7 +3265,7 @@ $.fn.dropdown = function(parameters) {
: function(){}
;
module.verbose('Doing menu show animation', $currentMenu);
module.set.direction($currentMenu);
module.set.direction($subMenu);
transition = module.get.transition($subMenu);
if( module.is.selection() ) {
module.set.scrollPosition(module.get.selectedItem(), true);
Expand Down Expand Up @@ -3311,14 +3334,6 @@ $.fn.dropdown = function(parameters) {
queue : true,
onStart : start,
onComplete : function() {
if(settings.direction == 'auto') {
if($currentMenu.hasClass(className.leftward)) {
module.remove.leftward($currentMenu);
}
if($currentMenu.hasClass(className.upward)) {
module.remove.upward($currentMenu);
}
}
callback.call(element);
}
})
Expand Down
2 changes: 1 addition & 1 deletion dist/components/dropdown.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/components/dropdown.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 7e37d4a

Please sign in to comment.