1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Possible fix for month view day deadzone

Summary: Ref T8193, Possible fix for month view day deadzone

Test Plan: Open Calendar month view in Chrome, Firefox, or Safari. Verify that days with many events still link to the day views of those days.

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8193

Differential Revision: https://secure.phabricator.com/D12969
This commit is contained in:
lkassianik 2015-05-21 17:11:26 -07:00
parent 680e8fdfdb
commit d3268aecc2
3 changed files with 28 additions and 11 deletions

View file

@ -123,7 +123,7 @@ return array(
'rsrc/css/layout/phabricator-source-code-view.css' => '2ceee894',
'rsrc/css/phui/calendar/phui-calendar-day.css' => 'c0cf782a',
'rsrc/css/phui/calendar/phui-calendar-list.css' => 'c1c7f338',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '94b1750a',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '476be7e0',
'rsrc/css/phui/calendar/phui-calendar.css' => 'ccabe893',
'rsrc/css/phui/phui-action-header-view.css' => '89c497e7',
'rsrc/css/phui/phui-action-list.css' => '4f4d09f2',
@ -767,7 +767,7 @@ return array(
'phui-calendar-css' => 'ccabe893',
'phui-calendar-day-css' => 'c0cf782a',
'phui-calendar-list-css' => 'c1c7f338',
'phui-calendar-month-css' => '94b1750a',
'phui-calendar-month-css' => '476be7e0',
'phui-crumbs-view-css' => '594d719e',
'phui-document-view-css' => '94d5dcd8',
'phui-feed-story-css' => 'c9f3a0b5',

View file

@ -117,8 +117,10 @@ final class PHUICalendarMonthView extends AphrontView {
foreach ($cell_lists_by_week as $week_of_cell_lists) {
$cells = array();
$max_count = $this->getMaxDailyEventsForWeek($week_of_cell_lists);
foreach ($week_of_cell_lists as $cell_list) {
$cells[] = $this->getEventListCell($cell_list);
$cells[] = $this->getEventListCell($cell_list, $max_count);
}
$rows[] = phutil_tag('tr', array(), $cells);
@ -153,7 +155,19 @@ final class PHUICalendarMonthView extends AphrontView {
return $box;
}
private function getEventListCell($event_list) {
private function getMaxDailyEventsForWeek($week_of_cell_lists) {
$max_count = 0;
foreach ($week_of_cell_lists as $cell_list) {
if ($cell_list['count'] > $max_count) {
$max_count = $cell_list['count'];
}
}
return $max_count;
}
private function getEventListCell($event_list, $max_count = 0) {
$list = $event_list['list'];
$class = $event_list['class'];
$uri = $event_list['uri'];
@ -162,7 +176,7 @@ final class PHUICalendarMonthView extends AphrontView {
$viewer_is_invited = $list->getIsViewerInvitedOnList();
$event_count_badge = $this->getEventCountBadge($count, $viewer_is_invited);
$cell_day_secret_link = $this->getHiddenDayLink($uri);
$cell_day_secret_link = $this->getHiddenDayLink($uri, $max_count, 125);
$cell_data_div = phutil_tag(
'div',
@ -191,7 +205,7 @@ final class PHUICalendarMonthView extends AphrontView {
if ($date) {
$uri = $event_list['uri'];
$cell_day_secret_link = $this->getHiddenDayLink($uri);
$cell_day_secret_link = $this->getHiddenDayLink($uri, 0, 25);
$cell_day = phutil_tag(
'a',
@ -291,11 +305,16 @@ final class PHUICalendarMonthView extends AphrontView {
$event_count);
}
private function getHiddenDayLink($uri) {
private function getHiddenDayLink($uri, $count, $max_height) {
// approximately the height of the tallest cell
$height = 18 * $count + 5;
$height = ($height > $max_height) ? $height : $max_height;
$height_style = 'height: '.$height.'px';
return phutil_tag(
'a',
array(
'class' => 'phui-calendar-month-secret-link',
'style' => $height_style,
'href' => $uri,
),
null);

View file

@ -54,9 +54,6 @@ a.phui-calendar-month-secret-link {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
outline: 0;
}
table.phui-calendar-view tr td:first-child {
@ -149,7 +146,8 @@ table.phui-calendar-view td.phui-calendar-date-number-container {
background: transparent;
}
.phui-calendar-view .phui-calendar-list {
.phui-calendar-view .phui-calendar-list,
.phui-calendar-view .phui-calendar-month-list {
padding: 1px;
width: auto;
}