continuing to work on the image example
This commit is contained in:
parent
df685d037c
commit
1deed94e04
|
@ -157,16 +157,18 @@ BaseImage.prototype.toDomNode = function(cache) {
|
||||||
var height = that.getHeight();
|
var height = that.getHeight();
|
||||||
var canvas = makeCanvas(width, height);
|
var canvas = makeCanvas(width, height);
|
||||||
|
|
||||||
|
|
||||||
// KLUDGE: on IE, the canvas rendering functions depend on a
|
// KLUDGE: on IE, the canvas rendering functions depend on a
|
||||||
// context where the canvas is attached to the DOM tree.
|
// context where the canvas is attached to the DOM tree.
|
||||||
|
|
||||||
// We initialize an afterAttach hook; the client's responsible
|
// We initialize an afterAttach hook; the client's responsible
|
||||||
// for calling this after the dom node is attached to the
|
// for calling this after the dom node is attached to the
|
||||||
// document.
|
// document.
|
||||||
canvas.afterAttach = function() {
|
$(canvas).bind('afterAttach',
|
||||||
var ctx = canvas.getContext("2d");
|
function(event) {
|
||||||
that.render(ctx, 0, 0);
|
var ctx = canvas.getContext("2d");
|
||||||
};
|
that.render(ctx, 0, 0);
|
||||||
|
});
|
||||||
return canvas;
|
return canvas;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
StandardOutputPort.prototype = baselib.heir(OutputPort.prototype);
|
StandardOutputPort.prototype = baselib.heir(OutputPort.prototype);
|
||||||
StandardOutputPort.prototype.writeDomNode = function(MACHINE, domNode) {
|
StandardOutputPort.prototype.writeDomNode = function(MACHINE, domNode) {
|
||||||
MACHINE.params['currentDisplayer'](MACHINE, domNode);
|
MACHINE.params['currentDisplayer'](MACHINE, domNode);
|
||||||
|
jQuery(domNode).trigger({type : 'afterAttach'});
|
||||||
};
|
};
|
||||||
|
|
||||||
var StandardErrorPort = function() {
|
var StandardErrorPort = function() {
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
StandardErrorPort.prototype = baselib.heir(OutputPort.prototype);
|
StandardErrorPort.prototype = baselib.heir(OutputPort.prototype);
|
||||||
StandardErrorPort.prototype.writeDomNode = function(MACHINE, domNode) {
|
StandardErrorPort.prototype.writeDomNode = function(MACHINE, domNode) {
|
||||||
MACHINE.params['currentErrorDisplayer'](MACHINE, domNode);
|
MACHINE.params['currentErrorDisplayer'](MACHINE, domNode);
|
||||||
|
jQuery(domNode).trigger({type : 'afterAttach'});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user