update components
This commit is contained in:
parent
6f21a963ea
commit
823f69bb92
68 changed files with 303 additions and 388 deletions
|
@ -3,7 +3,6 @@
|
|||
justify-content: center;
|
||||
padding: 0;
|
||||
border: none;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
|
||||
max-height: 84%;
|
||||
}
|
||||
|
||||
|
@ -11,7 +10,7 @@
|
|||
max-height: none;
|
||||
}
|
||||
|
||||
.actionSheet.centered .actionSheetContent {
|
||||
.actionSheetContent-centered {
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
@ -27,7 +26,7 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
button.actionSheetMenuItem {
|
||||
.actionSheetMenuItem {
|
||||
padding: 0 1.6em;
|
||||
margin: 0;
|
||||
text-transform: none;
|
||||
|
@ -68,23 +67,17 @@ button.actionSheetMenuItem {
|
|||
width: auto;
|
||||
}
|
||||
|
||||
h1.actionSheetTitle {
|
||||
.actionSheetTitle {
|
||||
margin: .5em 0 1em !important;
|
||||
padding: 0 1em;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
h2.actionSheetTitle {
|
||||
margin: .25em 0 .55em !important;
|
||||
padding: 0 1em;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.actionSheetText {
|
||||
padding: 0 1em;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.actionSheet.extraSpacing {
|
||||
.actionsheet-extraSpacing {
|
||||
font-size: 108%;
|
||||
}
|
||||
|
|
|
@ -107,13 +107,42 @@
|
|||
var dlg = dialogHelper.createDialog(dialogOptions);
|
||||
|
||||
if (!layoutManager.tv) {
|
||||
dlg.classList.add('extraSpacing');
|
||||
dlg.classList.add('actionsheet-extraSpacing');
|
||||
}
|
||||
|
||||
dlg.classList.add('actionSheet');
|
||||
|
||||
var html = '';
|
||||
html += '<div class="actionSheetContent">';
|
||||
|
||||
var scrollType = layoutManager.desktop ? 'smoothScrollY' : 'hiddenScrollY';
|
||||
var style = (browser.noFlex || browser.firefox) ? 'max-height:400px;' : '';
|
||||
|
||||
// Admittedly a hack but right now the scrollbar is being factored into the width which is causing truncation
|
||||
if (options.items.length > 20) {
|
||||
var minWidth = window.innerWidth >= 300 ? 240 : 200;
|
||||
style += "min-width:" + minWidth + "px;";
|
||||
}
|
||||
|
||||
var i, length, option;
|
||||
var renderIcon = false;
|
||||
for (i = 0, length = options.items.length; i < length; i++) {
|
||||
|
||||
option = options.items[i];
|
||||
option.icon = option.selected ? 'check' : null;
|
||||
|
||||
if (option.icon) {
|
||||
renderIcon = true;
|
||||
}
|
||||
}
|
||||
|
||||
// If any items have an icon, give them all an icon just to make sure they're all lined up evenly
|
||||
var center = options.title && (!renderIcon /*|| itemsWithIcons.length != options.items.length*/);
|
||||
|
||||
if (center) {
|
||||
html += '<div class="actionSheetContent actionSheetContent-centered">';
|
||||
} else {
|
||||
html += '<div class="actionSheetContent">';
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
|
||||
|
@ -133,35 +162,8 @@
|
|||
html += '</p>';
|
||||
}
|
||||
|
||||
var scrollType = layoutManager.desktop ? 'smoothScrollY' : 'hiddenScrollY';
|
||||
var style = (browser.noFlex || browser.firefox) ? 'max-height:400px;' : '';
|
||||
|
||||
// Admittedly a hack but right now the scrollbar is being factored into the width which is causing truncation
|
||||
if (options.items.length > 20) {
|
||||
var minWidth = window.innerWidth >= 300 ? 240 : 200;
|
||||
style += "min-width:" + minWidth + "px;";
|
||||
}
|
||||
html += '<div class="actionSheetScroller ' + scrollType + '" style="' + style + '">';
|
||||
|
||||
var i, length, option;
|
||||
var renderIcon = false;
|
||||
for (i = 0, length = options.items.length; i < length; i++) {
|
||||
|
||||
option = options.items[i];
|
||||
option.icon = option.selected ? 'check' : null;
|
||||
|
||||
if (option.icon) {
|
||||
renderIcon = true;
|
||||
}
|
||||
}
|
||||
|
||||
// If any items have an icon, give them all an icon just to make sure they're all lined up evenly
|
||||
var center = options.title && (!renderIcon /*|| itemsWithIcons.length != options.items.length*/);
|
||||
|
||||
if (center) {
|
||||
dlg.classList.add('centered');
|
||||
}
|
||||
|
||||
var itemTagName = 'button';
|
||||
|
||||
for (i = 0, length = options.items.length; i < length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue