element.parentNode.insertBefore(container, element);
container.insertBefore(element, button);
+ // check if the date input has one of the following classes set otherwise default to 'short'
+ var hasClass = false, knownClasses = ['tiny', 'short', 'medium', 'long'];
+ for (var i = 0; i < 4; i++) {
+ if (element.classList.contains(knownClasses[i])) {
+ hasClass = true;
+ }
+ }
+
+ if (!hasClass) {
+ element.classList.add('short')
+ }
+
_data.set(element, {
shadow: shadowElement,
_dateMonth = elCreate('select');
_dateMonth.className = 'month';
_dateMonth.addEventListener('change', this._changeMonth.bind(this));
- monthYearContainer.appendChild(_dateMonth);
+
+ var selectWrapper = elCreate('label');
+ selectWrapper.className = 'selectDropdown';
+ selectWrapper.appendChild(_dateMonth);
+ monthYearContainer.appendChild(selectWrapper);
var months = '', monthNames = Language.get('__monthsShort');
for (var i = 0; i < 12; i++) {
_dateYear = elCreate('select');
_dateYear.className = 'year';
_dateYear.addEventListener('change', this._changeYear.bind(this));
- monthYearContainer.appendChild(_dateYear);
+
+ selectWrapper = elCreate('label');
+ selectWrapper.className = 'selectDropdown';
+ selectWrapper.appendChild(_dateYear);
+ monthYearContainer.appendChild(selectWrapper);
_dateMonthNext = elCreate('a');
_dateMonthNext.className = 'icon icon16 fa-arrow-right next';
-// TODO: overhaul file
-
.inputAddon > .inputDatePicker {
- // TODO: background-color: @wcfInputBackgroundColor !important;
cursor: pointer;
flex: 0 1 150px;
min-width: 150px;
.datePicker {
background-color: $wcfDropdownBackground;
border: 1px solid $wcfDropdownBorder;
- border-radius: 3px;
+ box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, .2);
color: $wcfDropdownText;
opacity: 0;
position: absolute;
width: 240px;
z-index: 450;
- @include boxShadow(2px, 2px, rgba(0, 0, 0, .2), 10px);
-
&.active {
opacity: 1;
transition-delay: 0s;
> header,
> footer {
- padding: $wcfGapSmall;
+ padding: 10px;
position: relative;
text-align: center;
}
}
&.previous {
- left: $wcfGapSmall;
+ left: 10px;
}
&.next {
- right: $wcfGapSmall;
+ right: 10px;
}
}
- > ul {
+ .selectDropdown + .selectDropdown {
+ margin-left: 5px;
+ }
+
+ > ul > li {
border-top: 1px solid $wcfDropdownBorder;
+ display: flex;
- // hide borders
- margin: 0 -1px -1px 0;
+ > a,
+ > span {
+ display: block;
+ flex: 1;
+ padding: 5px 0;
+ text-align: center;
+
+ &:not(:last-child) {
+ border-right: 1px solid $wcfDropdownBorder;
+ }
+ }
- > li {
- display: flex;
+ > a {
+ color: $wcfDropdownLink;
- > a,
- > span {
- border: 1px solid $wcfDropdownBorder;
- border-width: 0 1px 1px 0;
- display: block;
- flex: 1;
- padding: $wcfGapTiny 0;
- text-align: center;
+ &:hover {
+ text-decoration: none;
}
- > a {
- // TODO: background-color: @wcfContainerAccentBackgroundColor;
- // TODO: color: @wcfColor;
-
- &:hover {
- text-decoration: none;
- }
-
- &.active,
- &:not(.otherMonth):hover {
- // TODO: background-color: @wcfContainerHoverBackgroundColor;
- }
-
- &.otherMonth {
- // TODO: background-color: @wcfContainerBackgroundColor;
- // TODO: color: @wcfDimmedColor;
- cursor: default;
- }
+ &.active,
+ &:not(.otherMonth):hover {
+ background-color: $wcfDropdownBackgroundActive;
+ color: $wcfDropdownLinkActive;
}
- > span {
- // TODO: background-color: @wcfTabularBoxBackgroundColor;
- // TODO: border-right-color: @wcfTabularBoxBackgroundColor;
- // TODO: color: @wcfTabularBoxColor;
- font-size: .85rem;
- text-transform: uppercase;
-
- // TODO: .textShadow(@wcfTabularBoxBackgroundColor);
+ &.otherMonth {
+ color: $wcfContentDimmedText;
+ cursor: default;
}
}
+
+ > span {
+ text-transform: uppercase;
+ @extend .wcfFontSmall;
+ }
}
> footer {