-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: SCHEDULER-111: improved scrolling
- Loading branch information
1 parent
49a88a4
commit 2bb227f
Showing
7 changed files
with
72 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { outsideWrapperId, leftColumnWidth, screenWidthMultiplier } from "@/constants"; | ||
|
||
export const getCanvasWidth = () => { | ||
const wrapperWidth = document.getElementById(outsideWrapperId)?.clientWidth || 0; | ||
const width = (wrapperWidth - leftColumnWidth) * screenWidthMultiplier; | ||
return width; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import { weekWidth, screenWidthMultiplier, dayWidth } from "@/constants"; | ||
import { | ||
weekWidth, | ||
dayWidth, | ||
outsideWrapperId, | ||
leftColumnWidth, | ||
screenWidthMultiplier | ||
} from "@/constants"; | ||
|
||
export const getCols = (zoom: number) => | ||
zoom === 0 | ||
? Math.ceil(window.innerWidth / weekWidth) * screenWidthMultiplier | ||
: Math.ceil(window.innerWidth / dayWidth) * screenWidthMultiplier; | ||
export const getCols = (zoom: number) => { | ||
const wrapperWidth = document.getElementById(outsideWrapperId)?.clientWidth || 0; | ||
const componentWidth = wrapperWidth - leftColumnWidth; | ||
const visibleCols = | ||
zoom === 0 ? Math.ceil(componentWidth / weekWidth) : Math.ceil(componentWidth / dayWidth); | ||
|
||
return visibleCols * screenWidthMultiplier; | ||
}; | ||
|
||
export const getVisibleCols = (zoom: number) => getCols(zoom) / screenWidthMultiplier; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters