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

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

Introduction

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

Prototype

public int outerWidth() 

Source Link

Document

Get the current computed width for the first element in the set of matched elements, including padding, border, but not the margin.

Usage

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

License:Apache License

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));
    }//  w  ww  .j av  a  2s.co m
    return elmt.outerWidth() - elmt.width();
}

From source file:com.vaadin.addons.sliderlayout.gwt.client.VSliderLayout.java

License:Apache License

private void rollTo(String id, final int slideTo, String animation, int duration) {
    GQuery panel = $(SLIDE_DEFAULT_CLASS_NAME + "-" + uidlId);

    if (panel == null)
        return;//w ww .j  a  v  a 2 s.  c om

    if (panel.widgets().size() == 0)
        panel.css(CSS.LEFT, "0");

    // animate slide to number
    panel.as(Effects)
            //.delay(1000)
            //.animate("left: -" + Integer.toString(100 * slideTo) + "%", 1000, EasingExt.EASE_OUT_BOUNCE, new Function() {
            // don't use 0% (only compatible with webkit browsers) for left property use 0px to be compatible with firefox and IE and opera !!!
            .animate("left: -" + Integer.toString(panel.outerWidth() * slideTo), duration, getEasing(animation),
                    new Function() {
                        boolean fistEvent = true;

                        public void f(Element e) {
                            // only send the first event from all slides movement 
                            if (fistEvent) {
                                client.updateVariable(uidlId, "fromSlideName", lastSlideName, false);
                                client.updateVariable(uidlId, "toSlideName", "v-slide-" + slideTo, true);

                                // save the last Slide name
                                lastSlideName = "v-slide-" + slideTo;

                                fistEvent = false;
                            }
                        }

                    });

}

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

License:Open Source License

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));
    }//from   w ww. ja  v a 2 s  .  co  m
    return elmt.outerWidth() - elmt.width();
}

From source file:gwtquery.plugins.draggable.client.plugins.SnapPlugin.java

License:Apache License

public void onStart(DraggableHandler handler, DragContext ctx, GqEvent e) {
    Element draggableElement = ctx.getDraggable();
    List<SnapElement> snapElements = new ArrayList<SnapElement>();
    GQuery snap = (handler.getOptions().getSnap_$() != null ? handler.getOptions().getSnap_$()
            : $(handler.getOptions().getSnap()));

    for (Element element : snap.elements()) {
        if (element != draggableElement) {
            GQuery $element = $(element);
            snapElements.add(new SnapElement($element.offset(), $element.outerWidth(), $element.outerHeight()));
        }//from w  w w. j  a v  a  2s  .  c  om
    }
    $(draggableElement).data(SNAP_ELEMENTS_KEY, snapElements);

}