src/cm/media/js/lib/yui/yui_3.0.0b1/build/widget/widget-position-min.js
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 0 40c8f766c9b8
permissions -rw-r--r--
add link to "privacy policy" in the header test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     1
/*
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     2
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     3
Code licensed under the BSD License:
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     4
http://developer.yahoo.net/yui/license.txt
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     5
version: 3.0.0b1
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     6
build: 1163
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     7
*/
40c8f766c9b8 import from internal svn r 4007
raph
parents:
diff changeset
     8
YUI.add("widget-position",function(A){var H=A.Lang,J=A.Widget,K="xy",F="positioned",I="boundingBox",L="renderUI",G="bindUI",D="syncUI",C=J.UI_SRC,E="xyChange";function B(M){this._posNode=this.get(I);A.after(this._renderUIPosition,this,L);A.after(this._syncUIPosition,this,D);A.after(this._bindUIPosition,this,G);}B.ATTRS={x:{setter:function(M){this._setX(M);},getter:function(){return this._getX();}},y:{setter:function(M){this._setY(M);},getter:function(){return this._getY();}},xy:{value:[0,0],validator:function(M){return this._validateXY(M);}}};B.POSITIONED_CLASS_NAME=J.getClassName(F);B.prototype={_renderUIPosition:function(){this._posNode.addClass(B.POSITIONED_CLASS_NAME);},_syncUIPosition:function(){this._uiSetXY(this.get(K));},_bindUIPosition:function(){this.after(E,this._afterXYChange);},move:function(){var M=arguments,N=(H.isArray(M[0]))?M[0]:[M[0],M[1]];this.set(K,N);},syncXY:function(){this.set(K,this._posNode.getXY(),{src:C});},_validateXY:function(M){return(H.isArray(M)&&H.isNumber(M[0])&&H.isNumber(M[1]));},_setX:function(M){this.set(K,[M,this.get(K)[0]]);},_setY:function(M){this.set(K,[this.get(K)[1],M]);},_getX:function(){return this.get(K)[0];},_getY:function(){return this.get(K)[1];},_afterXYChange:function(M){if(M.src!=C){this._uiSetXY(M.newVal);}},_uiSetXY:function(M){this._posNode.setXY(M);}};A.WidgetPosition=B;},"3.0.0b1",{requires:["widget"]});