Skip to content

Commit

Permalink
more forPrint simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed May 25, 2020
1 parent 16f27af commit b72f28d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 61 deletions.
2 changes: 1 addition & 1 deletion packages/common/src/styles/scrollgrid.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.fc-theme-standard .fc-scrollgrid {
border: 1px solid #ddd; // okay because bootstrap does this too
}
.fc-media-print .fc-scrollgrid {
.fc-media-print .fc-scrollgrid { // allows it to stretch so that hard-set widths of inner table push it out!?
table-layout: auto;
}

Expand Down
46 changes: 23 additions & 23 deletions packages/timegrid/src/TimeCol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface TimeColProps {
eventDrag: EventSegUiInteractionState | null
eventResize: EventSegUiInteractionState | null
slatCoords: TimeColsSlatsCoords
forPrint: boolean
}

export class TimeCol extends BaseComponent<TimeColProps> {
Expand Down Expand Up @@ -102,33 +101,34 @@ export class TimeCol extends BaseComponent<TimeColProps> {
) {
let { props } = this

if (props.forPrint) {
return this.renderPrintFgSegs(segs)
} else if (props.slatCoords) {
// if (props.forPrint) {
// return this.renderPrintFgSegs(segs)
// } else
if (props.slatCoords) {
return this.renderPositionedFgSegs(segs, segIsInvisible, isDragging, isResizing, isDateSelecting)
}
}


renderPrintFgSegs(segs: TimeColsSeg[]) {
let { props } = this

return segs.map((seg) => (
<div
className='fc-timegrid-event-harness'
key={seg.eventRange.instance.instanceId}
>
<TimeColEvent
seg={seg}
isDragging={false}
isResizing={false}
isDateSelecting={false}
isSelected={false}
{...getSegMeta(seg, props.todayRange, props.nowDate)}
/>
</div>
))
}
// renderPrintFgSegs(segs: TimeColsSeg[]) {
// let { props } = this

// return segs.map((seg) => (
// <div
// className='fc-timegrid-event-harness'
// key={seg.eventRange.instance.instanceId}
// >
// <TimeColEvent
// seg={seg}
// isDragging={false}
// isResizing={false}
// isDateSelecting={false}
// isSelected={false}
// {...getSegMeta(seg, props.todayRange, props.nowDate)}
// />
// </div>
// ))
// }


renderPositionedFgSegs(
Expand Down
1 change: 0 additions & 1 deletion packages/timegrid/src/TimeCols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export class TimeCols extends BaseComponent<TimeColsProps, TimeColsState> {
tableColGroupNode={props.tableColGroupNode}
slatCoords={state.slatCoords}
onColCoords={this.handleColCoords}
forPrint={props.forPrint}
/>
</div>
)
Expand Down
2 changes: 0 additions & 2 deletions packages/timegrid/src/TimeColsContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export interface TimeColsContentProps {
eventDrag: EventSegUiInteractionState | null
eventResize: EventSegUiInteractionState | null
nowIndicatorSegs: TimeColsSeg[]
forPrint: boolean
clientWidth: number | null
tableMinWidth: CssDimValue
tableColGroupNode: VNode
Expand Down Expand Up @@ -102,7 +101,6 @@ export class TimeColsContent extends BaseComponent<TimeColsContentProps> { // TO
eventResize={eventResizeByRow[i]}
slatCoords={props.slatCoords}
eventSelection={props.eventSelection}
forPrint={props.forPrint}
/>
))}
</tr>
Expand Down
34 changes: 15 additions & 19 deletions packages/timegrid/src/styles/timegrid-cols.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@
overflow: hidden;
}

.fc-media-screen {

.fc-timegrid-cols {
position: absolute; // no z-index. children will decide and go above slots
top: 0;
left: 0;
right: 0;
bottom: 0;

& > table {
height: 100% !important;
}
}
.fc-timegrid-cols {
position: absolute; // no z-index. children will decide and go above slots
top: 0;
left: 0;
right: 0;
bottom: 0;

.fc-timegrid-col-origin {
position: relative;
height: 0; // all segments position themselves based on this div
& > table {
height: 100% !important;
}
}

.fc-timegrid-event-harness {
position: absolute; // top/left/right/bottom will all be set by JS
}
.fc-timegrid-col-origin {
position: relative;
height: 0; // all segments position themselves based on this div
}

.fc-timegrid-event-harness {
position: absolute; // top/left/right/bottom will all be set by JS
}


Expand Down
21 changes: 6 additions & 15 deletions packages/timegrid/src/styles/timegrid-event.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,12 @@
}
}

.fc-media-screen {
.fc-timegrid-event {
position: absolute;
top: 0;
bottom: 1px; // stay away from bottom slot line
left: 0;
right: 0;
}
}

.fc-media-print {
.fc-timegrid-event {
margin-top: .25em;
margin-bottom: .25em;
}
.fc-timegrid-event {
position: absolute;
top: 0;
bottom: 1px; // stay away from bottom slot line
left: 0;
right: 0;
}


Expand Down

0 comments on commit b72f28d

Please sign in to comment.