Skip to content

Commit

Permalink
Merge pull request #1085 from nextcloud/bug/fix-datepicker
Browse files Browse the repository at this point in the history
Fix datepicker alignment
  • Loading branch information
georgehrke committed Mar 24, 2019
2 parents 86fdafd + 0dc08e9 commit 8565883
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 30 deletions.
30 changes: 29 additions & 1 deletion css/app/calendarlist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ ul#calendarlistcontainer {

#datepicker-ng-show-container {
display: block !important;
height: 185px;
height: 205px;
overflow: hidden;
transition: 200ms ease-in-out all;
}
Expand All @@ -334,6 +334,34 @@ ul#calendarlistcontainer {
height: 0;
}

div.uib-daypicker {
display: flex;

table {
flex: 1;

tbody {
flex: 1;
display: flex;
flex-direction: column;

tr.uib-weeks {
flex: 1;
display: flex;
width: 100%;
justify-content: space-evenly;

td.uib-day {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
}
}
}
}
}

/* Spacing */
#spacer {
height: 44px;
Expand Down
64 changes: 37 additions & 27 deletions css/app/datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@
font-weight: normal;
}

#datepicker table {
display: inline-block;
margin-left: 5px;
}
#datepicker {
table {
display: inline-block;
margin-left: 5px;

#datepicker table td button {
margin: 0;
font-weight: 300;
}
td button {
margin: 0;
font-weight: 300;
}
}

#datepicker thead {
display: none;
thead {
display: none;
}
}

#datepicker td button {
Expand All @@ -75,12 +77,13 @@

#datepicker table tbody button {
margin: 0;
padding: 6px 9px;
padding: 8px 9px;
background: transparent;
cursor: pointer;
border-radius: 0;
border-top: 0;
border-left: 0;
min-width: 34px;
}

#datepicker table tbody tr td button {
Expand All @@ -92,7 +95,7 @@
}

#datepicker table tbody button.active {
border-radius: 50%;
border-radius: var(--border-radius-pill);
background-color: $color-primary;
color: $color-primary-text;
font-weight: bold;
Expand All @@ -117,7 +120,7 @@
#app-navigation .datepicker-heading,
#app-navigation .togglebuttons {
display: flex;
justify-content: space-around;
justify-content: space-between;
margin: 0 5px;
width: calc(100% - 10px);
}
Expand All @@ -134,6 +137,25 @@
flex-grow: 1;
}

#app-navigation .togglebuttons .button {

border-radius: 0;

&.first {
margin-right: -1px;
border-radius: var(--border-radius) 0 0 var(--border-radius);
}

&.middle {
margin: auto 0;
}

&.last {
margin-left: -1px;
border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
}

#app-navigation .datepicker-heading .button:hover,
#app-navigation .togglebuttons .button:hover,
#app-navigation .datepicker-heading .button.active,
Expand All @@ -145,29 +167,17 @@
#app-navigation .togglebuttons .icon-view-previous {
margin-right: -1px;
border-radius: 3px 0 0 3px;
flex-grow: 1;
}

#app-navigation .datepicker-heading .button.middle,
#app-navigation .togglebuttons .button.middle {
margin-left: 0;
margin-right: 0;
border-radius: 0;
flex-grow: 2;
flex-grow: 0;
}

#app-navigation .datepicker-heading .icon-view-next,
#app-navigation .togglebuttons .icon-view-next {
margin-left: -1px;
border-radius: 0 3px 3px 0;
flex-grow: 1;
flex-grow: 0;
}

#app-navigation .datepicker-heading .icon-view-previous,
#app-navigation .datepicker-heading .icon-view-next {
width: 35px;
}

#app-navigation .datepicker-heading .button.middle {
width: calc(100% - 70px);
}
4 changes: 2 additions & 2 deletions js/.stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"rules": {
"indentation": "tab",
"number-leading-zero": "never",
"no-descending-specificity": false,
"no-duplicate-selectors": false,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"comment-empty-line-before": ["always", {
"except": ["first-nested"]
}]
Expand Down

0 comments on commit 8565883

Please sign in to comment.