Add support for onResize handler.

This commit is contained in:
Jürg Lehni 2011-05-15 23:46:34 +01:00
parent 3bd4db802c
commit 535e5fc5fc
2 changed files with 16 additions and 1 deletions

View file

@ -141,7 +141,8 @@ var PaperScript = this.PaperScript = new function() {
// Define variables for potential handlers, so eval() calls below to
// fetch their values do not require try-catch around them.
var onEditOptions, onSelect, onDeselect, onReselect, onMouseDown,
onMouseUp, onMouseDrag, onMouseMove, onKeyDown, onKeyUp, onFrame;
onMouseUp, onMouseDrag, onMouseMove, onKeyDown, onKeyUp,
onFrame, onResize;
var res = eval(compile(code));
if (tool) {
Base.each(['onEditOptions', 'onSelect', 'onDeselect',
@ -153,6 +154,7 @@ var PaperScript = this.PaperScript = new function() {
);
}
if (view) {
view.onResize = onResize;
if (onFrame) {
view.setOnFrame(onFrame);
} else {