git @ Cat's Eye Technologies yoob.js / 6b06f37
this. inline-block. yes. Chris Pressey 10 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
3737 * than the desired width & height? defaults to true.
3838 * `missingCanvasElement`: if allowContraction is false, this should be
3939 * a DOM element whose `display` style will be changed from `none` to
40 * `block` when the viewport is too small to display the canvas.
40 * `inline-block` when the viewport is too small to display the canvas.
4141 * `centerVertically`: should we apply a top margin to the canvas
4242 * element, to equal half the available space below it, after resizing
4343 * it? defaults to defaults to true.
126126 if (newWidth > availWidth || newHeight > availHeight) {
127127 // due to not allowing contraction, our canvas is still
128128 // too big to display. hide it and show the other thing
129 canvas.style.display = 'none';
129 this.canvas.style.display = 'none';
130130 if (this.missingCanvasElement) {
131 this.missingCanvasElement.style.display = 'block';
131 this.missingCanvasElement.style.display = 'inline-block';
132132 }
133133 } else {
134 canvas.style.display = 'block';
134 this.canvas.style.display = 'inline-block';
135135 if (this.missingCanvasElement) {
136136 this.missingCanvasElement.style.display = 'none';
137137 }