File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/java/gwt/material/design/addins/client/timepicker Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ public class MaterialTimePicker extends AbstractValueWidget<Date> implements Has
121121 private boolean detectOrientation = false ;
122122 private Orientation orientation = Orientation .PORTRAIT ;
123123
124+ protected HandlerRegistration orientationHandler ;
125+
124126 public MaterialTimePicker () {
125127 super (Document .get ().createElement ("div" ), AddinsCssName .TIMEPICKER , CssName .INPUT_FIELD );
126128 }
@@ -236,12 +238,14 @@ public void setOrientation(Orientation orientation) {
236238 public void setDetectOrientation (boolean detectOrientation ) {
237239 this .detectOrientation = detectOrientation ;
238240
239- window ().off ("resize.lolliclock-orientation" );
241+ if (orientationHandler != null ) {
242+ orientationHandler .removeHandler ();
243+ orientationHandler = null ;
244+ }
240245
241246 if (detectOrientation ) {
242- window (). on ( "resize.lolliclock-orientation" , e -> {
247+ orientationHandler = com . google . gwt . user . client . Window . addResizeHandler ( resizeEvent -> {
243248 detectAndApplyOrientation ();
244- return true ;
245249 });
246250 detectAndApplyOrientation ();
247251 }
You can’t perform that action at this time.
0 commit comments