File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,11 +379,6 @@ let smoothScroll =
379379 null ) ;
380380
381381$ . smoothScroll = function ( el , end ) {
382- if ( ! window . requestAnimationFrame ) {
383- el . scrollTop = end ;
384- return ;
385- }
386-
387382 smoothEnd = end ;
388383
389384 if ( smoothScroll ) {
@@ -472,22 +467,6 @@ $.classify = function (string) {
472467 return string . join ( "" ) ;
473468} ;
474469
475- $ . framify = function ( fn , obj ) {
476- if ( window . requestAnimationFrame ) {
477- return ( ...args ) => requestAnimationFrame ( fn . bind ( obj , ...args ) ) ;
478- } else {
479- return fn ;
480- }
481- } ;
482-
483- $ . requestAnimationFrame = function ( fn ) {
484- if ( window . requestAnimationFrame ) {
485- requestAnimationFrame ( fn ) ;
486- } else {
487- setTimeout ( fn , 0 ) ;
488- }
489- } ;
490-
491470//
492471// Miscellaneous
493472//
Original file line number Diff line number Diff line change @@ -1255,8 +1255,8 @@ var Prism = (function (_self) {
12551255 highlightAutomaticallyCallback ,
12561256 ) ;
12571257 } else {
1258- if ( window . requestAnimationFrame ) {
1259- window . requestAnimationFrame ( highlightAutomaticallyCallback ) ;
1258+ if ( requestAnimationFrame ) {
1259+ requestAnimationFrame ( highlightAutomaticallyCallback ) ;
12601260 } else {
12611261 window . setTimeout ( highlightAutomaticallyCallback , 16 ) ;
12621262 }
Original file line number Diff line number Diff line change 12901290
12911291 fill ( _window , "setTimeout" , wrapTimeFn , wrappedBuiltIns ) ;
12921292 fill ( _window , "setInterval" , wrapTimeFn , wrappedBuiltIns ) ;
1293- if ( _window . requestAnimationFrame ) {
1293+ if ( _requestAnimationFrame ) {
12941294 fill (
12951295 _window ,
12961296 "requestAnimationFrame" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ app.views.ListFocus = class ListFocus extends app.View {
1414
1515 constructor ( el ) {
1616 super ( el ) ;
17- this . focusOnNextFrame = $ . framify ( this . focus , this ) ;
17+ this . focusOnNextFrame = ( el ) => requestAnimationFrame ( ( ) => this . focus ( el ) ) ;
1818 }
1919
2020 focus ( el , options ) {
Original file line number Diff line number Diff line change @@ -28,9 +28,7 @@ app.views.BasePage = class BasePage extends app.View {
2828 this . delay ( this . afterRender ) ;
2929 }
3030 if ( this . highlightNodes . length > 0 ) {
31- $ . requestAnimationFrame ( ( ) =>
32- $ . requestAnimationFrame ( ( ) => this . paintCode ( ) ) ,
33- ) ;
31+ requestAnimationFrame ( ( ) => this . paintCode ( ) ) ;
3432 }
3533 }
3634
@@ -68,7 +66,7 @@ app.views.BasePage = class BasePage extends app.View {
6866 }
6967
7068 if ( this . highlightNodes . length > 0 ) {
71- $ . requestAnimationFrame ( ( ) => this . paintCode ( ) ) ;
69+ requestAnimationFrame ( ( ) => this . paintCode ( ) ) ;
7270 }
7371 this . previousTiming = timing ;
7472 }
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ app.views.Search = class Search extends app.View {
203203 if ( context . hash ) {
204204 this . delay ( this . searchUrl ) ;
205205 }
206- $ . requestAnimationFrame ( ( ) => this . autoFocus ( ) ) ;
206+ requestAnimationFrame ( ( ) => this . autoFocus ( ) ) ;
207207 }
208208
209209 extractHashValue ( ) {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ app.views.DocPicker = class DocPicker extends app.View {
5050
5151 this . html ( html + this . tmpl ( "docPickerNote" ) ) ;
5252
53- $ . requestAnimationFrame ( ( ) => this . findByTag ( "input" ) ?. focus ( ) ) ;
53+ requestAnimationFrame ( ( ) => this . findByTag ( "input" ) ?. focus ( ) ) ;
5454 }
5555
5656 renderVersions ( docs ) {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ app.views.Sidebar = class Sidebar extends app.View {
6464
6565 resetHoverOnMouseMove ( ) {
6666 $ . off ( window , "mousemove" , this . resetHoverOnMouseMove ) ;
67- return $ . requestAnimationFrame ( ( ) => this . resetHover ( ) ) ;
67+ return requestAnimationFrame ( ( ) => this . resetHover ( ) ) ;
6868 }
6969
7070 resetHover ( ) {
You can’t perform that action at this time.
0 commit comments