/** * Store arbitrary data associated with the matched elements in the named data store. */ public GQuery data(String name, Object value) { for (Element e : elements()) { data(e, name, value); } return this; }
protected Element[] getElementsBase(String n) { return g.children(n).elements(); }
/** * Unselect all previously selected values. */ public void unselectAll() { for (Element selected : $("option:selected", this).elements()) { OptionElement.as(selected).setSelected(false); } }
/** * Unselect all previously selected values. */ public void unselectAll() { for (Element selected : $("option:selected", this).elements()) { OptionElement.as(selected).setSelected(false); } }
private GQuery getFirstActive() { for (Element element : searchResults.elements()) { GQuery gq = $(element); if (gq.hasClass(css.activeResult())) { return gq; } } return $(); }
private GQuery getFirstActive() { for (Element element : searchResults.elements()) { GQuery gq = $(element); if (gq.hasClass(css.activeResult())) { return gq; } } return $(); }
for (Element element : elements()) { GQuery g = $(element);
public void removeAttribute(GQuery gQuery, String key) { for (Element e : gQuery.elements()) { if (e.getNodeType() != 1) { continue; } if (JsUtils.hasProperty(e, key)) { if (BOOLEAN_ATTR_REGEX.test(key)) { e.setPropertyBoolean(key, false); } else { e.setPropertyObject(key, null); } } e.removeAttribute(key); } }
/** * Check if the {@link Element Element} <code>root</code> is attached to the * widget. If it is the case, adopt the widget. If not, check if the chidren * are linked to a widget to adopt them. * */ protected void adoptSubWidgets(Element root) { GQuery children = $(root).children(); for (Element child : children.elements()) { Widget w = $(child).widget(); if (w != null) { doAdopt(w); } else { adoptSubWidgets(child); } } }
public void setAttribute(GQuery gQuery, String key, Object value) { AttributeSetter setter = getAttributeSetter(key); if (setter.isRemoval(value)) { gQuery.removeAttr(key); return; } value = fixValue(key, value); for (Element e : gQuery.elements()) { int nodeType = e.getNodeType(); // don't set attribute on text, comment and attributes nodes if (nodeType == 3 || nodeType == 8 || nodeType == 2) { continue; } setter.setAttribute(e, key, value); } }
private void winnowResultsClear() { searchField.val(""); GQuery lis = searchResults.find("li"); for (Element li : lis.elements()) { GQuery $li = $(li); if ($li.hasClass(css.groupResult())) { $li.css("display", ""); } else if (!isMultiple || !$li.hasClass(css.resultSelected())) { resultActivate($li); } } }
private void winnowResultsClear() { searchField.val(""); GQuery lis = searchResults.find("li"); for (Element li : lis.elements()) { GQuery $li = $(li); if ($li.hasClass(css.groupResult())) { $li.css("display", ""); } else if (shouldActivateResult($li)) { resultActivate($li); } $li.removeClass(css.foundResult()); } } }
private void winnowResultsClear() { searchField.val(""); GQuery lis = searchResults.find("li"); for (Element li : lis.elements()) { GQuery $li = $(li); if ($li.hasClass(css.groupResult())) { $li.css("display", ""); } else if (shouldActivateResult($li)) { resultActivate($li); } $li.removeClass(css.foundResult()); } } }
/** * Removes all matched elements from the DOM and cleans their data and bound events if the value * of <code>clean</code> parameter is set to true. The <code> filter</code> parameter allows to * filter the matched set to remove. */ protected GQuery remove(String filter, boolean clean) { for (Element e : elements) { if (filter == null || $(e).filter(filter).length() == 1) { if (clean) { // clean data linked to the children // TODO: "*" fails in queryselectorall (webkit mobile) cleanGQData($("*", e).elements()); // clean data linked to the element itself cleanGQData(e); } Widget w = getAssociatedWidget(e); if (w != null) { w.removeFromParent(); } else { e.removeFromParent(); } } } return this; }