code: function() {
              var offset = this.container.offset(),
                  height = this.container.outerHeight(),
                  width = this.container.outerWidth(),
                  dropHeight = this.dropdown.outerHeight(),
                  viewportBottom = $(window).scrollTop() + document.documentElement.clientHeight,
                  dropTop = offset.top + height,
                  dropLeft = offset.left,
                  enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
                  enoughRoomAbove = (offset.top - dropHeight) >= this.body().scrollTop(),
                  aboveNow = this.dropdown.hasClass("select2-drop-above"),
                  bodyOffset,
                  above,
                  css;
  
              // console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
              // console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body().scrollTop(), "enough?", enoughRoomAbove);
  
              // fix positioning when body has an offset and is not position: static
  
              if (this.body().css('position') !== 'static') {
                  bodyOffset = this.body().offset();
                  dropTop -= bodyOffset.top;
                  dropLeft -= bodyOffset.left;
              }
  
              // always prefer the current above/below alignment, unless there is not enough room
  
              if (aboveNow) {
                  above = true;
                  if (!enoughRoomAbove && enoughRoomBelow) above = false;
              } else {
                  above = false;
                  if (!enoughRoomBelow && enoughRoomAbove) above = true;
              }
  
              if (above) {
                  dropTop = offset.top - dropHeight;
                  this.container.addClass("select2-drop-above");
                  this.dropdown.addClass("select2-drop-above");
              }
              else {
                  this.container.removeClass("select2-drop-above");
                  this.dropdown.removeClass("select2-drop-above");
              }
  
              css = $.extend({
                  top: dropTop,
                  left: dropLeft,
                  width: width
              }, evaluate(this.opts.dropdownCss));
  
              this.dropdown.css(css);
          }
docs: abstract