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

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

Introduction

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

Prototype

public GQuery parents(String... filters) 

Source Link

Document

Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element).

Usage

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

License:Apache License

protected void choiceDestroy(GQuery link) {
    choices--;/*ww w. ja  v a  2s. co  m*/
    showSearchFieldDefault(defaultText);

    if (isMultiple() && choices > 0 && searchField.val() != null && searchField.val().length() < 1) {
        resultsHide();
    }

    resultDeselect(Integer.parseInt(link.attr("rel")), link.attr("data-chosen-value"));
    link.parents("li").first().remove();
}

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

License:Apache License

protected void containerMouseDownImpl(Event e, GQuery element) {
    if (!activeField) {
        $(document).click(clickTestAction);
        resultsShow();//ww  w  .j  av  a 2  s  .c  om
    } else if (!element.isEmpty() && (element.get(0) == selectedItem.get(0)
            || element.parents("a." + css.chznSingle()).length() > 0)) {
        e.preventDefault();
        resultsToggle();
    }

    if (!element.hasClass(css.activeResult())) {
        activateField();
    }
}

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

License:Apache License

protected boolean searchResultsMouseOut(Event e) {
    Element targetEl = e.getEventTarget().cast();
    GQuery $e = $(targetEl);

    if ($e.hasClass(css.activeResult()) || $e.parents("." + css.activeResult()).length() > 0) {
        resultClearHighlight();/*w ww. j a v  a  2s  .  co  m*/
    }

    return false;
}

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

License:Apache License

protected boolean searchResultsMouseUp(Event e) {
    Element targetEvent = e.getEventTarget().cast();
    GQuery $e = $(targetEvent);

    GQuery target = $e.hasClass(css.activeResult()) ? $e : $e.parents("." + css.activeResult()).first();
    if (!target.isEmpty()) {
        resultHighlight = target;/*from  ww w  . ja va2 s  .  c o m*/
        resultSelect(e);
    }

    return false;
}

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

License:Apache License

boolean searchResultsMouseOver(Event e) {
    Element targetEl = e.getEventTarget().cast();
    GQuery $e = $(targetEl);

    GQuery target = $e.hasClass(css.activeResult()) ? $e : $e.parents("." + css.activeResult()).first();
    if (!target.isEmpty()) {
        resultDoHighlight(target);//from   ww  w .  j a  v  a 2s. co  m
    }

    return false;
}

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

License:Apache License

private boolean testActiveClick(Event e) {
    Element target = e.getEventTarget().cast();
    GQuery $e = $(target);

    if ($e.parents("#" + containerId).length() > 0) {
        activeField = true;/*  ww w . j  a  v  a 2 s  .c o m*/
    } else {
        closeField();
    }
    return true;
}

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

License:Apache License

private boolean choicesClick(Event e) {
    e.preventDefault();/*from w  w  w . jav  a 2  s  . c o  m*/

    Element target = e.getEventTarget().cast();
    GQuery $e = $(target);

    if (activeField
            && !($e.hasClass(getCss().searchChoice()) || !$e.parents("." + getCss().searchChoice()).isEmpty())
            && !resultsShowing) {
        resultsShow();
    }
    return true;
}

From source file:com.arcbees.gquery.tooltip.client.TooltipImpl.java

License:Apache License

private boolean onDocumentClick(Event e) {
    Element target = e.getEventTarget().cast();
    GQuery $e = $(target);

    // Ensure that the user didn't click on the tooltip
    if ($e.parents("." + style.tooltip()).length() == 0) {
        hide();/* w ww . ja v a 2s . c  o m*/
    }
    return false;
}

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

License:Open Source License

private void choiceDestroy(GQuery link) {
    choices--;/*from  ww w  . j a  v a 2s.  c om*/
    showSearchFieldDefault();
    if (isMultiple && choices > 0 && searchField.val() != null && searchField.val().length() < 1) {
        resultsHide();
    }

    resultDeselect(Integer.parseInt(link.attr("rel")));
    link.parents("li").first().remove();
}

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

License:Open Source License

private boolean choicesClick(Event e) {
    e.preventDefault();//  w  w w.j  a  v  a2s .c o m

    Element target = e.getEventTarget().cast();
    GQuery $e = $(target);

    if (activeField && !($e.hasClass(css.searchChoice()) || !$e.parents("." + css.searchChoice()).isEmpty())
            && !resultsShowing) {
        resultsShow();
    }
    return false;
}