Browse Source

Rebuild 2.2.11 for release

pull/5359/merge 2.2.11
Jack 7 years ago
parent
commit
7e37d4a098
8 changed files with 221 additions and 187 deletions
  1. 30
      dist/components/dropdown.css
  2. 163
      dist/components/dropdown.js
  3. 2
      dist/components/dropdown.min.css
  4. 4
      dist/components/dropdown.min.js
  5. 30
      dist/semantic.css
  6. 163
      dist/semantic.js
  7. 2
      dist/semantic.min.css
  8. 14
      dist/semantic.min.js

30
dist/components/dropdown.css

@ -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;
}
/*--------------
@ -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;
}
@ -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);
}

163
dist/components/dropdown.js

@ -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) {
@ -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() {
@ -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);
},
@ -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
@ -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');
}
},
@ -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() {
@ -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);
@ -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);
}
})

2
dist/components/dropdown.min.css
File diff suppressed because it is too large
View File

4
dist/components/dropdown.min.js
File diff suppressed because it is too large
View File

30
dist/semantic.css

@ -30258,6 +30258,7 @@ select.ui.dropdown {
.ui.dropdown .menu .left.menu {
left: auto;
right: 100%;
margin: 0em -0.5em 0em 0em !important;
border-radius: 0.28571429rem !important;
}
@ -30265,19 +30266,20 @@ select.ui.dropdown {
.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;
}
/*--------------
@ -30543,7 +30545,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;
}
@ -30703,50 +30705,50 @@ 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);
}
/*******************************

163
dist/semantic.js

@ -6725,29 +6725,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) {
@ -7097,12 +7097,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() {
@ -7409,6 +7409,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);
},
@ -7427,46 +7431,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
@ -7529,6 +7493,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');
}
},
@ -7545,26 +7517,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() {
@ -7599,7 +7622,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);
@ -7668,14 +7691,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);
}
})

2
dist/semantic.min.css
File diff suppressed because it is too large
View File

14
dist/semantic.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save