@Deprecated public static void add(WindowScrollListener listener) { Window.addWindowScrollHandler(new WrapWindowScroll(listener)); }
@Deprecated public static void add(WindowScrollListener listener) { Window.addWindowScrollHandler(new WrapWindowScroll(listener)); }
@Deprecated public static void add(WindowScrollListener listener) { Window.addWindowScrollHandler(new WrapWindowScroll(listener)); }
public static Observable<Window.ScrollEvent> windowScroll() { return Observable.create(s -> register(s, Window.addWindowScrollHandler(s::onNext)), uiBackpressureMode()); } }
public static Observable<Window.ScrollEvent> windowScroll() { return Observable.create(s -> register(s, Window.addWindowScrollHandler(s::onNext))); } }
private void addScrollHandlers() { final ScrollPanel scrollAncestor = getScrollAncestor(); if (scrollAncestor != null) { scrollAncestor.addScrollHandler(new com.google.gwt.event.dom.client.ScrollHandler() { @Override public void onScroll(com.google.gwt.event.dom.client.ScrollEvent event) { eventBus.fireEvent(new ScrollEvent(scrollAncestor)); } }); } else { // attach scroll handler to window (if scrollAncestor can't be identified) Window.addWindowScrollHandler(new Window.ScrollHandler() { @Override public void onWindowScroll(Window.ScrollEvent event) { eventBus.fireEvent(new ScrollEvent(scrollAncestor)); } }); } }
@Override public void execute() { Affix.this.reset(); Affix.this.handlerRegistrationCollection.add(Window.addWindowScrollHandler(Affix.this.scrollHandler)); Affix.this.handlerRegistrationCollection.add(Window.addResizeHandler(Affix.this.resizeHandler)); } });
@Override public void execute() { Affix.this.reset(); Affix.this.handlerRegistrationCollection.add(Window.addWindowScrollHandler(Affix.this.scrollHandler)); Affix.this.handlerRegistrationCollection.add(Window.addResizeHandler(Affix.this.resizeHandler)); } });
/** * Configures a resize handler and a scroll handler on the window to * properly adjust the Cut Out. */ protected void setupWindowHandlers() { registerHandler(Window.addResizeHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle))); registerHandler(Window.addWindowScrollHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle))); }
private void registerScrollHandler() { if (this.scrollRegistration != null) { this.scrollRegistration.removeHandler(); } if (this.isBodyScrollWidget()) { this.scrollRegistration = Window.addWindowScrollHandler(new Window.ScrollHandler() { @Override public void onWindowScroll(Window.ScrollEvent event) { NavSpy.this.scheduleRefresh(); } }); } else { this.scrollRegistration = this.scrollWidget.addDomHandler(new ScrollHandler() { @Override public void onScroll(ScrollEvent event) { NavSpy.this.scheduleRefresh(); } }, ScrollEvent.getType()); } }
private void registerScrollHandler() { if (this.scrollRegistration != null) { this.scrollRegistration.removeHandler(); } if (this.isBodyScrollWidget()) { this.scrollRegistration = Window.addWindowScrollHandler(new Window.ScrollHandler() { @Override public void onWindowScroll(Window.ScrollEvent event) { NavSpy.this.scheduleRefresh(); } }); } else { this.scrollRegistration = this.scrollWidget.addDomHandler(new ScrollHandler() { @Override public void onScroll(ScrollEvent event) { NavSpy.this.scheduleRefresh(); } }, ScrollEvent.getType()); } }
private void setImageUrl(final SafeUri purl) { if (isInViewPort()) { super.setUrl(purl); parkedUri = null; if (scrollHandler != null) { scrollHandler.removeHandler(); } if (resizeHandler != null) { resizeHandler.removeHandler(); } } else { parkedUri = purl; if (scrollHandler == null) { scrollHandler = Window.addWindowScrollHandler(pScrollEvent -> { if (isInViewPort()) { super.setUrl(parkedUri); } }); } if (resizeHandler == null) { resizeHandler = Window.addResizeHandler(pResizeEvent -> { if (isInViewPort()) { super.setUrl(parkedUri); } }); } } }
@Override protected void onLoad() { super.onLoad(); $("header").css("position", "fixed"); $("header").css("width", "100%"); final boolean[] fired = {false}; registerHandler(Window.addWindowScrollHandler(scrollEvent -> { int distanceY = window().scrollTop(); if (distanceY > scrollOffset) { $(getElement()).addClass("smaller"); if (!fired[0]) { NavBarShrinkEvent.fire(this); fired[0] = true; } } else { if ($(getElement()).hasClass("smaller")) { $(getElement()).removeClass("smaller"); NavBarExpandEvent.fire(this); fired[0] = false; } } })); }
@Override protected void onLoad() { super.onLoad(); $("header").css("position", "fixed"); $("header").css("width", "100%"); final boolean[] fired = {false}; registerHandler(Window.addWindowScrollHandler(scrollEvent -> { int distanceY = window().scrollTop(); if (distanceY > scrollOffset) { $(getElement()).addClass("smaller"); if (!fired[0]) { NavBarShrinkEvent.fire(this); fired[0] = true; } } else { if ($(getElement()).hasClass("smaller")) { $(getElement()).removeClass("smaller"); NavBarExpandEvent.fire(this); fired[0] = false; } } })); }