code: function(dir) {
  		if (typeof dir === 'undefined') {
  			this._dir=null;
  		} else if (("" + parseInt(dir)) == dir) { //dir is a number
        this._dir={
          x: Math.cos(dir/180*Math.PI)
          , y: Math.sin(dir/180*Math.PI)
        };
      }
      else {
        var r=Math.sqrt(dir.x * dir.x + dir.y * dir.y)
  			this._dir={
          x: dir.x/r
          , y: dir.y/r
        };
  		}
  	}
docs: @
  #.dragDirection
  @comp Draggable
  @sign public this .dragDirection()
  Remove any previously specified direction.
  
  @sign public this .dragDirection(vector)
  @param vector - Of the form of {x: valx, y: valy}, the vector (valx, valy) denotes the move direction.
  
  @sign public this .dragDirection(degree)
  @param degree - A number, the degree (clockwise) of the move direction with respect to the x axis.
  Specify the dragging direction.
  
  @example
  ~~~
  this.dragDirection()
  this.dragDirection({x:1, y:0}) //Horizontal
  this.dragDirection({x:0, y:1}) //Vertical
  // Note: because of the orientation of x and y axis,
  // this is 45 degree clockwise with respect to the x axis.
  this.dragDirection({x:1, y:1}) //45 degree.
  this.dragDirection(60) //60 degree.
  ~~~