Dart Documentationdock_spawnResizeHandle

ResizeHandle Class

Methods

Code void adjustSize(Element container) #

void adjustSize(Element container) {
  int clientWidth = container.$dom_clientWidth;
  int clientHeight = container.$dom_clientHeight;
  
  if (corner) {
    if (west) element.style.left = "0px";
    if (east) element.style.left = "${clientWidth - cornerSize}px";
    if (north) element.style.top = "0px";
    if (south) element.style.top = "${clientHeight - cornerSize}px";
  }
  else {
    if (west) {
      element.style.left = "0px";
      element.style.top = "${cornerSize}px";
    }
    if (east) {
      element.style.left = "${clientWidth - handleSize}px";
      element.style.top = "${cornerSize}px";
    }
    if (north) {
      element.style.left = "${cornerSize}px";
      element.style.top = "0px";
    }
    if (south) {
      element.style.left = "${cornerSize}px";
      element.style.top = "${clientHeight - handleSize}px";
    }
    
    if (west || east) {
      element.style.height = "${clientHeight - cornerSize * 2}px";
    } else {
      element.style.width = "${clientWidth - cornerSize * 2}px";
    }
  }
}

Fields

Code bool corner #

bool corner = false;

Code final int cornerSize #

final int cornerSize = 12;

Code bool east #

bool east = false;

Code DivElement element #

DivElement element;

Code final int handleSize #

final int handleSize = 6;

Code var mouseDownHandler #

var mouseDownHandler;

Code var mouseMoveHandler #

var mouseMoveHandler;

Code var mouseUpHandler #

var mouseUpHandler;

Code bool north #

bool north = false;

Code bool south #

bool south = false;

Code bool west #

bool west = false;