protected int getSideBorderPadding(GQuery elmt, boolean isHidden) { if (isHidden) { // bug in gquery when one parent of the element is hidden return (int) (elmt.cur("padding-left", true) + elmt.cur("padding-right", true) + elmt.cur("border-left-width", true) + elmt.cur("border-right-width", true)); } return elmt.outerWidth() - elmt.width(); }
private int getSideBorderPadding(GQuery elmt, boolean isHidden) { if (isHidden) { //bug in gquery when one parent of the element is hidden return (int) (elmt.cur("padding-left", true) + elmt.cur("padding-right", true) + elmt.cur("border-left-width", true) + elmt.cur("border-right-width", true)); } return elmt.outerWidth() - elmt.width(); }
protected int getSideBorderPadding(GQuery elmt, boolean isHidden) { if (isHidden) { // bug in gquery when one parent of the element is hidden return (int) (elmt.cur("padding-left", true) + elmt.cur("padding-right", true) + elmt.cur("border-left-width", true) + elmt.cur("border-right-width", true)); } return elmt.outerWidth() - elmt.width(); }
@Override protected void searchFieldScale(int fWidth) { StringBuilder styleBlock = new StringBuilder("position:absolute; " + (isRTL() ? "right" : "left") + ": -1000px; top: -1000px; " + "visibility:hidden;"); String[] styleToCopy = {"font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"}; for (String style : styleToCopy) { styleBlock.append(style).append(':').append(getSearchField().css(style)).append(";"); } GQuery div = $("<div />").attr("style", styleBlock.toString()).text(getSearchField().val()); $("body").append(div); int w = div.width() + 25; div.remove(); if (w > fWidth - 10) { w = fWidth - 10; } getSearchField().css("width", w + "px"); }
@Override protected void searchFieldScale(int fWidth) { StringBuilder styleBlock = new StringBuilder("position:absolute; " + (isRTL() ? "right" : "left") + ": -1000px; top: -1000px; " + "visibility:hidden;"); String[] styleToCopy = {"font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"}; for (String style : styleToCopy) { styleBlock.append(style).append(':').append(getSearchField().css(style)).append(";"); } GQuery div = $("<div />").attr("style", styleBlock.toString()).text(getSearchField().val()); $("body").append(div); int w = div.width() + 25; div.remove(); if (w > fWidth - 10) { w = fWidth - 10; } getSearchField().css("width", w + "px"); }
private void searchFieldScale() { if (!isMultiple) { return; } StringBuilder styleBlock = new StringBuilder("position:absolute; " + (isRTL ? "right" : "left") + ": -1000px; top: -1000px; " + "visibility:hidden;"); String[] styleToCopy = { "font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"}; for (String style : styleToCopy) { styleBlock.append(style).append(':').append(searchField.css(style)); } GQuery div = $("<div />").attr("style", styleBlock.toString()).text(searchField.val()); $("body").append(div); int w = div.width() + 25; div.remove(); if (w > fWidth - 10) { w = fWidth - 10; } searchField.css("width", w + "px"); int ddTop = container.height(); dropdown.css("top", ddTop + "px"); }
@Override public void onStart() { boolean hidden = !g.isVisible(); super.onStart(); if (action == null) { return; } currentAction = action != Action.TOGGLE ? action : hidden ? Action.SHOW : Action.HIDE; g.saveCssAttrs(attrsToSave); // CSS clip only works with absolute/fixed positioning if (!g.css("position", true).matches("absolute|fixed")) { // Add a temporary element to replace the original one, so nothing is moved when // setting the absolute position to our element back = back.add(g.before("<div></div>")).prev(); back.height(g.height()); back.width(g.width()); // change the position property, but keeping its original position and sizes g.css("top", g.offset().top + "px"); g.css("left", g.offset().left + "px"); g.css("width", g.width() + "px"); g.css("height", g.height() + "px"); g.css("position", "absolute"); } g.css("overflow", "hidden"); g.css("visivility", "visible"); // Set the initial clip viewport before showing the element onUpdate(0); g.show(); }
$(ChosenTemplate.templates.container(containerId, cssClasses).asString()).width(fWidth);
$(ChosenTemplate.templates.container(containerId, cssClasses).asString()).width(fWidth);
$(ChozenTemplate.templates.container(containerId, cssClasses).asString()).width(fWidth);