File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/Umbraco.Web.UI.Client/src/common/services Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 11( function ( ) {
22 "use strict" ;
33
4- function focusLockService ( ) {
5- var elementToInert = document . querySelector ( '#mainwrapper' ) ;
4+ function focusLockService ( $document ) {
5+ var elementToInert = $ document[ 0 ] . querySelector ( '#mainwrapper' ) ;
66
77 function addInertAttribute ( ) {
8- elementToInert . setAttribute ( 'inert' , true ) ;
8+ if ( elementToInert ) {
9+ elementToInert . setAttribute ( 'inert' , true ) ;
10+ }
911 }
1012
1113 function removeInertAttribute ( ) {
12- elementToInert . removeAttribute ( 'inert' ) ;
14+ if ( elementToInert ) {
15+ elementToInert . removeAttribute ( 'inert' ) ;
16+ }
1317 }
1418
1519 var service = {
2024 return service ;
2125
2226 }
23-
27+
2428 angular . module ( "umbraco.services" ) . factory ( "focusLockService" , focusLockService ) ;
2529
2630} ) ( ) ;
You can’t perform that action at this time.
0 commit comments