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

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

Introduction

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

Prototype

public GQuery next() 

Source Link

Document

Get a set of elements containing the unique next siblings of each of the given set of elements.

Usage

From source file:com.arcbees.chosen.client.ChosenImpl.java

License:Apache License

private void keydownArrow() {
    if (isNotResultHighlighted()) {
        activateFirstResult();/*w  ww. j a va  2s  . co  m*/
    } else if (resultsShowing) {
        // TODO should be replaced by :
        // GQuery nextSibling = resultHighlight.nextAll("li."+css.activeResult()).first();
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery nextSibling = resultHighlight.next();

        while (!nextSibling.isEmpty() && !nextSibling.is("li." + css.activeResult())) {
            nextSibling = nextSibling.next();
        }

        resultDoHighlight(nextSibling);
    }

    if (!resultsShowing) {
        resultsShow();
    }
}

From source file:com.watopi.chosen.client.ChosenImpl.java

License:Open Source License

private void keydownArrow() {
    if (resultHighlight == null) {
        GQuery firstActive = searchResults.find("li." + css.activeResult()).first();
        if (firstActive != null) {
            resultDoHighlight(firstActive);
        }/*from w w  w  .  ja v a  2  s .co  m*/
    } else if (resultsShowing) {
        // TODO should be replaced by :
        // GQuery nextSibling = resultHighlight.nextAll("li."+css.activeResult()).first();
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery nextSibling = resultHighlight.next();

        while (!nextSibling.isEmpty() && !nextSibling.is("li." + css.activeResult())) {
            nextSibling = nextSibling.next();
        }

        resultDoHighlight(nextSibling);

    }

    if (!resultsShowing) {
        resultsShow();
    }
}