File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 760760 // Load existing media
761761 csk . ajax . request ( url , {
762762 type : "GET" ,
763- beforeSend : function ( ) {
763+ beforeSend : function ( ) {
764764 $browser . empty ( ) . html ( '<div class="text-center py-5 text-muted">' + csk . i18n . default . loading + '</div>' ) ;
765765
766766 $insert . prop ( 'disabled' , true ) ;
916916 } ) ;
917917 } , 0 ) ) ;
918918
919- csk . ui . delegate ( 'click' , '[data-media-browse]' , function ( ) {
919+ /**
920+ * Media browser access.
921+ * @since 3.12.0
922+ */
923+ csk . ui . delegate ( 'click' , '[data-media-browse]' , function ( ) {
920924 const el = this ;
921925
922926 csk . media . browse ( {
928932 } ) ;
929933 } ) ;
930934
935+ /**
936+ * Improves scroll/touch performance automatically.
937+ * @since 3.12.0
938+ */
939+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
940+ try {
941+ let opts = Object . defineProperty ( { } , 'passive' , {
942+ get : function ( ) {
943+ window . __passiveSupported = true ;
944+ }
945+ } ) ;
946+ window . addEventListener ( 'test' , null , opts ) ;
947+ } catch ( e ) { }
948+
949+ if ( window . __passiveSupported ) {
950+ document . addEventListener ( 'touchstart' , function ( ) { } , { passive : true } ) ;
951+ document . addEventListener ( 'wheel' , function ( ) { } , { passive : true } ) ;
952+ }
953+ } ) ;
954+
931955 // Things to do when the page is ready!
932956 $ ( document ) . ready ( function ( ) {
933957 /**
You can’t perform that action at this time.
0 commit comments