Fix breadcrumb resizing in non-chrome browsers
this would break in browsers that don’t have requestIdleCallback. It is fine to write `window.propertyThatDoesntExist` but not just `propertyThatDoesntExist` the latter will say “Uncaught ReferenceError: propertyThatDoesntExist is not defined” I just barely added this 4 days ago so if we merge it before branching Beta we won’t need to warmfix it Test plan: * breadcrumbs should resize fine in non browsers that don’t support requestIdleCallback (https://caniuse.com/#search=requestIdleCallback) eg: safari and edge Change-Id: I711410e54af5e73afab2d5dcbaa9a7e0c778ae4d Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213785 Tested-by: Jenkins Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com> QA-Review: Brent Burgoyne <bburgoyne@instructure.com> Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
This commit is contained in:
parent
f4a67da30d
commit
78edfb531b
|
@ -274,8 +274,8 @@ $(function() {
|
||||||
let taskID
|
let taskID
|
||||||
|
|
||||||
const resizeBreadcrumb = () => {
|
const resizeBreadcrumb = () => {
|
||||||
if (taskID) (cancelIdleCallback || cancelAnimationFrame)(taskID)
|
if (taskID) (window.cancelIdleCallback || window.cancelAnimationFrame)(taskID)
|
||||||
taskID = (requestIdleCallback || requestAnimationFrame)(() => {
|
taskID = (window.requestIdleCallback || window.requestAnimationFrame)(() => {
|
||||||
let maxWidth = 500
|
let maxWidth = 500
|
||||||
$breadcrumbEllipsis = $breadcrumbEllipsis || $breadcrumbs.find('.ellipsible')
|
$breadcrumbEllipsis = $breadcrumbEllipsis || $breadcrumbs.find('.ellipsible')
|
||||||
$breadcrumbEllipsis.ifExists(() => {
|
$breadcrumbEllipsis.ifExists(() => {
|
||||||
|
|
Loading…
Reference in New Issue