77 * Licensed under the Apache License, Version 2.0 (the "License");
88 * you may not use this file except in compliance with the License.
99 * You may obtain a copy of the License at
10- *
10+ *
1111 * http://www.apache.org/licenses/LICENSE-2.0
12- *
12+ *
1313 * Unless required by applicable law or agreed to in writing, software
1414 * distributed under the License is distributed on an "AS IS" BASIS,
1515 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3838import gwt .material .design .client .js .JsSideNavOptions ;
3939import gwt .material .design .client .ui .*;
4040import gwt .material .design .client .ui .html .ListItem ;
41+ import gwt .material .design .jquery .client .api .JQueryElement ;
4142
4243import static gwt .material .design .client .js .JsMaterialElement .$ ;
4344
@@ -242,7 +243,6 @@ public void load() {
242243
243244 @ Override
244245 public void unload () {
245- $ ("#sidenav-overlay" ).remove ();
246246 activator = null ;
247247 }
248248
@@ -402,6 +402,7 @@ protected MaterialWidget getNavMenu() {
402402
403403 protected void onClosing () {
404404 open = false ;
405+ $ ("#sidenav-overlay" ).remove ();
405406 SideNavClosingEvent .fire (this );
406407 }
407408
@@ -411,13 +412,18 @@ protected void onClosed() {
411412
412413 protected void onOpening () {
413414 open = true ;
415+
416+ $ ("#sidenav-overlay" ).each ((param1 , element ) -> element .removeFromParent ());
414417 SideNavOpeningEvent .fire (this );
415418 }
416419
417420 protected void onOpened () {
418421 if (allowBodyScroll ) {
419422 RootPanel .getBodyElement ().getStyle ().clearOverflow ();
420423 }
424+
425+ String overlayZIndex = $ ("#sidenav-overlay" ).css ("zIndex" );
426+ $ (".drag-target" ).css ("zIndex" , (overlayZIndex != null ? Integer .parseInt (overlayZIndex ) : 1 ) + "" );
421427 SideNavOpenedEvent .fire (this );
422428 }
423429
@@ -552,6 +558,14 @@ public Element getActivator() {
552558 return activator ;
553559 }
554560
561+ public JQueryElement getOverlayElement () {
562+ return $ ("#sidenav-overlay" );
563+ }
564+
565+ public JQueryElement getDragTargetElement () {
566+ return $ (".drag-target" );
567+ }
568+
555569 @ Override
556570 public HandlerRegistration addOpeningHandler (SideNavOpeningEvent .SideNavOpeningHandler handler ) {
557571 return addHandler (handler , SideNavOpeningEvent .TYPE );
0 commit comments