src/includes/suggestions.js
function (e) {
        var that = this,
            elLayout = {},
            wrapperOffset,
            origin;

        that.isMobile = that.$viewport.width() <= that.options.mobileWidth;

        if (!that.isInitialized() || (e && e.type == 'scroll' && !(that.options.floating || that.isMobile))) return;
        that.$container.appendTo(that.options.floating ? that.$body : that.$wrapper);

        that.notify('resetPosition');
        // reset input's padding to default, determined by css
        that.el.css('paddingLeft', '');
        that.el.css('paddingRight', '');
        elLayout.paddingLeft = parseFloat(that.el.css('paddingLeft'));
        elLayout.paddingRight = parseFloat(that.el.css('paddingRight'));

        $.extend(elLayout, that.el.offset());
        elLayout.borderTop = that.el.css('border-top-style') == 'none' ? 0 : parseFloat(that.el.css('border-top-width'));
        elLayout.borderLeft = that.el.css('border-left-style') == 'none' ? 0 : parseFloat(that.el.css('border-left-width'));
        elLayout.innerHeight = that.el.innerHeight();
        elLayout.innerWidth = that.el.innerWidth();
        elLayout.outerHeight = that.el.outerHeight();
        elLayout.componentsLeft = 0;
        elLayout.componentsRight = 0;
        wrapperOffset = that.$wrapper.offset();

        origin = {
            top: elLayout.top - wrapperOffset.top,
            left: elLayout.left - wrapperOffset.left
        };

        that.notify('fixPosition', origin, elLayout);

        if (elLayout.componentsLeft > elLayout.paddingLeft) {
            that.el.css('paddingLeft', elLayout.componentsLeft + 'px');
        }
        if (elLayout.componentsRight > elLayout.paddingRight) {
            that.el.css('paddingRight', elLayout.componentsRight + 'px');
        }
    }
function (e) {
        var that = this,
            elLayout = {},
            wrapperOffset,
            origin;

        that.isMobile = that.$viewport.width() <= that.options.mobileWidth;

        if (!that.isInitialized() || (e && e.type == 'scroll' && !(that.options.floating || that.isMobile))) return;
        that.$container.appendTo(that.options.floating ? that.$body : that.$wrapper);

        that.notify('resetPosition');
        // reset input's padding to default, determined by css
        that.el.css('paddingLeft', '');
        that.el.css('paddingRight', '');
        elLayout.paddingLeft = parseFloat(that.el.css('paddingLeft'));
        elLayout.paddingRight = parseFloat(that.el.css('paddingRight'));

        $.extend(elLayout, that.el.offset());
        elLayout.borderTop = that.el.css('border-top-style') == 'none' ? 0 : parseFloat(that.el.css('border-top-width'));
        elLayout.borderLeft = that.el.css('border-left-style') == 'none' ? 0 : parseFloat(that.el.css('border-left-width'));
        elLayout.innerHeight = that.el.innerHeight();
        elLayout.innerWidth = that.el.innerWidth();
        elLayout.outerHeight = that.el.outerHeight();
        elLayout.componentsLeft = 0;
        elLayout.componentsRight = 0;
        wrapperOffset = that.$wrapper.offset();

        origin = {
            top: elLayout.top - wrapperOffset.top,
            left: elLayout.left - wrapperOffset.left
        };

        that.notify('fixPosition', origin, elLayout);

        if (elLayout.componentsLeft > elLayout.paddingLeft) {
            that.el.css('paddingLeft', elLayout.componentsLeft + 'px');
        }
        if (elLayout.componentsRight > elLayout.paddingRight) {
            that.el.css('paddingRight', elLayout.componentsRight + 'px');
        }
    }
function ( e ) { var that = this , elLayout = { } , wrapperOffset , origin ; that . isMobile = that . $viewport . width ( ) <= that . options . mobileWidth ; if ( ! that . isInitialized ( ) || ( e && e . type == 'scroll' && ! ( that . options . floating || that . isMobile ) ) ) return ; that . $container . appendTo ( that . options . floating ? that . $body : that . $wrapper ) ; that . notify ( 'resetPosition' ) ; // reset input's padding to default, determined by css that . el . css ( 'paddingLeft' , '' ) ; that . el . css ( 'paddingRight' , '' ) ; elLayout . paddingLeft = parseFloat ( that . el . css ( 'paddingLeft' ) ) ; elLayout . paddingRight = parseFloat ( that . el . css ( 'paddingRight' ) ) ; $ . extend ( elLayout , that . el . offset ( ) ) ; elLayout . borderTop = that . el . css ( 'border-top-style' ) == 'none' ? 0 : parseFloat ( that . el . css ( 'border-top-width' ) ) ; elLayout . borderLeft = that . el . css ( 'border-left-style' ) == 'none' ? 0 : parseFloat ( that . el . css ( 'border-left-width' ) ) ; elLayout . innerHeight = that . el . innerHeight ( ) ; elLayout . innerWidth = that . el . innerWidth ( ) ; elLayout . outerHeight = that . el . outerHeight ( ) ; elLayout . componentsLeft = 0 ; elLayout . componentsRight = 0 ; wrapperOffset = that . $wrapper . offset ( ) ; origin = { top : elLayout . top - wrapperOffset . top , left : elLayout . left - wrapperOffset . left } ; that . notify ( 'fixPosition' , origin , elLayout ) ; if ( elLayout . componentsLeft > elLayout . paddingLeft ) { that . el . css ( 'paddingLeft' , elLayout . componentsLeft + 'px' ) ; } if ( elLayout . componentsRight > elLayout . paddingRight ) { that . el . css ( 'paddingRight' , elLayout . componentsRight + 'px' ) ; } }
Common public methods
Common public methods