Skip to content

Commit

Permalink
This was actually a feature request as it operates in addition to the…
Browse files Browse the repository at this point in the history
… standard. Anyway, both the animation & active preview on a resize have been implemented. [#392 state:resolved milestone:2.0.3 owner:dleffler]
  • Loading branch information
dleffler committed Nov 4, 2011
1 parent efb2aea commit d9925b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions framework/modules/pixidou/assets/js/pixidou.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pixidou = {
imageHistoryIndex: 0, // index to know where we are in our image history
savedState: true, // whether the image must be saved or not in order to continue (useful for resize/crop)
currentTool: null, // current tool, currently resize/crop

/**
* Initializes the whole thing to get going
* @params image String
Expand All @@ -26,6 +26,7 @@ pixidou = {
pixidou.image = image;
pixidou.imageWidth = width;
pixidou.imageHeight = height;

},

/**
Expand Down Expand Up @@ -176,17 +177,24 @@ pixidou = {
proxy: true,
ghost: true,
status: true,
draggable: false
draggable: false,
animate: true,
animateDuration: .25,
animateEasing: YAHOO.util.Easing.backBoth
});

pixidou.resize.on('startResize', function() {
this.getProxyEl().innerHTML = '<img src="' + this.get('element').src + '" style="height: 100%; width: 100%;">';
Dom.setStyle(this.getProxyEl().firstChild, 'opacity', '.25');
}, pixidou.resize, true);

// remove any listeners for the apply/cancel button
YAHOO.util.Event.removeListener('applyTool', 'click');
YAHOO.util.Event.removeListener('cancelTool', 'click');

// set new listeners
YAHOO.util.Event.addListener('applyTool', 'click', pixidou.applyResizeTool);
YAHOO.util.Event.addListener('cancelTool', 'click', pixidou.disableResizeTool);

// show the buttons in the footer
ui.enableApplyButton();

Expand Down

0 comments on commit d9925b2

Please sign in to comment.