resize-base.js revision 99a0f1980cb492371b8d8ce039c7d14b93f115f4
function(str) {
var out = [],
Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for
function Resize() {
ATTRS: {
activeHandle: {
value: null,
validator: function(v) {
value: null,
autoHide: {
value: false,
defMinHeight: {
defMinWidth: {
handles: {
readOnly: true,
node: {
resizing: {
value: false,
wrap: {
value: false,
wrapTypes: {
readOnly: true,
wrapper: {
readOnly: true,
writeOnce: true
RULES: {
Y.Base,
'<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' +
* Stores the <a href="Resize.html#config_node">node</a>
* <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.
nodeSurrounding: null,
* Stores the <a href="Resize.html#config_wrapper">wrapper</a>
* <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.
wrapperSurrounding: null,
changeHeightHandles: false,
changeLeftHandles: false,
changeTopHandles: false,
changeWidthHandles: false,
delegate: null,
info: null,
lastInfo: null,
originalInfo: null,
initializer: function() {
this.renderer();
renderUI: function() {
var instance = this;
bindUI: function() {
var instance = this;
syncUI: function() {
var instance = this;
destructor: function() {
var instance = this,
if (pNode) {
renderer: function() {
this.renderUI();
this.bindUI();
this.syncUI();
var instance = this;
Y.each(
function(handle, i) {
_bindDD: function() {
var instance = this;
dragConfig: {
useShim: true,
move: false
target: false
_bindHandle: function() {
var instance = this,
wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE);
wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE);
_createEvents: function() {
var instance = this,
queuable: false,
emitFacade: true,
bubbles: true,
_renderHandles: function() {
var instance = this,
var instance = this;
_calcResize: function() {
var instance = this,
* <a href="Resize.html#property_info">info</a> to respect the
var instance = this,
// forcing the offsetHeight/offsetWidth to be the passed size
// predicting, based on the original information, the last left valid in case of reach the min/max dimension
* Copy relevant styles of the <a href="Resize.html#config_node">node</a>
* to the <a href="Resize.html#config_wrapper">wrapper</a>.
wrapperStyle = {
function(node) {
* <p>Generates metadata to the <a href="Resize.html#property_info">info</a>
* and <a href="Resize.html#property_originalInfo">originalInfo</a></p>
if (event) {
* <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">
* http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.
var info = {
padding: {},
margin: {},
border: {}
info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));
info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));
info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));
info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));
return info;
* <a href="Resize.html#property_info">info</a>.
_syncUI: function() {
var instance = this,
// the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node
var instance = this;
* Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).
var instance = this;
* <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,
* <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,
* <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,
* <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.
_updateSurroundingInfo: function() {
var instance = this,
var instance = this,
if (activeHandleNode) {
if (val) {
function(handleEl) {
var instance = this,
handles = [];
Y.each(
function(node, i) {
return handles;
var instance = this,
if (val) {
var instance = this,
val = true;
return val;
var instance = this;
var instance = this;
var instance = this;
var instance = this;
var instance = this,
info,
var instance = this;
var instance = this,
var instance = this;
var instance = this,
* Mouseenter event handler for the <a href="Resize.html#config_wrapper">wrapper</a>.
var instance = this;
* Mouseleave event handler for the <a href="Resize.html#config_wrapper">wrapper</a>.
var instance = this;
* Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).
var instance = this,
var instance = this;
_valueHandlesWrapper: function() {
_valueWrapper: function() {
var instance = this,
if (pNode) {
return wrapper;
setter: function() {
value: null,
writeOnce: true