public void open ( ) { setCutOutStyle ( ) ; if ( targetElement == null ) { throw new IllegalStateException ( "The target element should be set before calling open()." ) ; } targetElement . scrollIntoView ( ) ; if ( computedBackgroundColor == null ) { setupComputedBackgroundColor ( ) ; } //temporarily disables scrolling by setting the overflow of the page to hidden Style docStyle = Document . get ( ) . getDocumentElement ( ) . getStyle ( ) ; viewportOverflow = docStyle . getOverflow ( ) ; docStyle . setProperty ( "overflow" , "hidden" ) ; if ( backgroundSize == null ) { backgroundSize = body ( ) . width ( ) + 300 + "px" ; } setupTransition ( ) ; if ( animated ) { focusElement . getStyle ( ) . setProperty ( "boxShadow" , "0px 0px 0px 0rem " + computedBackgroundColor ) ; //the animation will take place after the boxshadow is set by the deferred command Scheduler . get ( ) . scheduleDeferred ( ( ) -> { focusElement . getStyle ( ) . setProperty ( "boxShadow" , "0px 0px 0px " + backgroundSize + " " + computedBackgroundColor ) ; } ) ; } else { focusElement . getStyle ( ) . setProperty ( "boxShadow" , "0px 0px 0px " + backgroundSize + " " + computedBackgroundColor ) ; } if ( circle ) { focusElement . getStyle ( ) . setProperty ( "WebkitBorderRadius" , "50%" ) ; focusElement . getStyle ( ) . setProperty ( "borderRadius" , "50%" ) ; // Temporary fixed for the IOS Issue on recalculation of the border radius focusElement . getStyle ( ) . setProperty ( "webkitBorderTopLeftRadius" , "49.9%" ) ; focusElement . getStyle ( ) . setProperty ( "borderTopLeftRadius" , "49.9%" ) ; } else { focusElement . getStyle ( ) . clearProperty ( "WebkitBorderRadius" ) ; focusElement . getStyle ( ) . clearProperty ( "borderRadius" ) ; focusElement . getStyle ( ) . clearProperty ( "webkitBorderTopLeftRadius" ) ; focusElement . getStyle ( ) . clearProperty ( "borderTopLeftRadius" ) ; } setupCutOutPosition ( focusElement , targetElement , cutOutPadding , circle ) ; setupWindowHandlers ( ) ; getElement ( ) . getStyle ( ) . clearDisplay ( ) ; // verify if the component is added to the document (via UiBinder for // instance) if ( getParent ( ) == null ) { autoAddedToDocument = true ; RootPanel . get ( ) . add ( this ) ; } OpenEvent . fire ( this , this ) ; }
Opens the dialog cut out taking all the screen . The target element should be set before calling this method .