Example usage for com.google.gwt.query.client GQuery unbind

List of usage examples for com.google.gwt.query.client GQuery unbind

Introduction

In this page you can find the example usage for com.google.gwt.query.client GQuery unbind.

Prototype

public GQuery unbind(String eventList) 

Source Link

Document

Removes all events that match the eventList.

Usage

From source file:com.arcbees.beestore.client.application.widget.slider.Slider.java

License:Apache License

public void updateFromCurrentBrand() {
    Brand newBrand = currentBrand.get();
    if (newBrand == brand) {
        return;//from  w ww  . j ava 2  s. co m
    }

    brand = newBrand;

    $(contents).find("a").each(new Function() {
        @Override
        public void f() {
            String dataBrand = $(this).attr("data-brand");
            if (brand.getValue().equals(dataBrand)) {
                GQuery li = $(this).parent();
                li.unbind(BrowserEvents.CLICK);
                handleClick(li);
            }
        }
    });
}

From source file:com.pronoiahealth.olhie.client.widgets.booklist3d.BookList3D.java

License:Open Source License

/**
 * Remove all events from list// w w  w  .jav a2s  .  co  m
 */
public void removeEventsFromLst() {
    if (books != null) {
        books.each(new Function() {
            @Override
            public void f(Element e) {
                final GQuery book = $(e);
                final GQuery page = book.children("div.bk-page");
                final GQuery parent = book.parent();
                final GQuery bookview = parent.find("button.bk-bookview");
                final GQuery flipAction = parent.find("button.bk-bookback");
                final GQuery toc = page.find("div.bk-toc");
                final GQuery tocPageMyCollectionsBtn = toc.find("a.bk-tocPage-myCollectionsBtn");
                final GQuery content = page.children("div.bk-content");
                final GQuery downloadContentBtns = page.find("a.bk-download-btn");
                final GQuery viewContentBtns = page.find("a.bk-view-btn");
                final GQuery tocItems = page.find("div.bk-toc-item");
                final GQuery tocLinks = page.find("div.bk-toc-link");

                book.unbind(Event.ONCLICK);
                flipAction.unbind(Event.ONCLICK);
                bookview.unbind(Event.ONCLICK);
                if (content.length() > 1) {
                    GQuery navPrev = page.find(".bk-page-prev");
                    if (navPrev != null) {
                        navPrev.unbind(Event.ONCLICK);
                        navPrev.remove();
                    }

                    GQuery navNext = page.find(".bk-page-next");
                    if (navNext != null) {
                        navNext.unbind(Event.ONCLICK);
                        navNext.remove();
                    }

                    // Unbind TOC items
                    tocItems.each().unbind(Event.ONCLICK);
                }
                tocPageMyCollectionsBtn.unbind(Event.ONCLICK);
                tocItems.each(new Function() {
                    @Override
                    public void f(com.google.gwt.dom.client.Element e) {
                        $(e).unbind(Event.ONCLICK);
                    }
                });
                tocLinks.each(new Function() {
                    @Override
                    public void f(com.google.gwt.dom.client.Element e) {
                        $(e).unbind(Event.ONCLICK);
                    }
                });
                viewContentBtns.each(new Function() {
                    @Override
                    public void f(com.google.gwt.dom.client.Element e) {
                        $(e).unbind(Event.ONCLICK);
                    }
                });
                downloadContentBtns.each(new Function() {
                    @Override
                    public void f(com.google.gwt.dom.client.Element e) {
                        $(e).unbind(Event.ONCLICK);
                    }
                });
            }
        });
    }
}

From source file:jetbrains.jetpad.cell.toDom.CellContainerToDomMapper.java

License:Apache License

private Registration eventRegistration(final int event, Object o, Function f) {
    final GQuery q = $(o);
    q.bind(event, f);/*w  w  w . j ava2s.co m*/
    return new Registration() {
        @Override
        protected void doRemove() {
            q.unbind(event);
        }
    };
}

From source file:jetbrains.jetpad.projectional.view.toGwt.ViewContainerToElementMapper.java

License:Apache License

private Registration eventRegistration(final int event, Object e, Function f) {
    final GQuery q = $(e);
    q.bind(event, f);//from w  w w.j  a  v  a 2  s .c om
    return new Registration() {
        @Override
        protected void doRemove() {
            q.unbind(event);
        }
    };
}