diff --git a/core/modules/widgets/image.js b/core/modules/widgets/image.js index 1c4ba494e..afa8b447b 100644 --- a/core/modules/widgets/image.js +++ b/core/modules/widgets/image.js @@ -97,10 +97,10 @@ ImageWidget.prototype.render = function(parent,nextSibling) { domNode.setAttribute("class",this.imageClass); } if(this.imageWidth) { - domNode.setAttribute("width",parseInt(this.imageWidth,10) + "px"); + domNode.setAttribute("width",this.imageWidth); } if(this.imageHeight) { - domNode.setAttribute("height",parseInt(this.imageHeight,10) + "px"); + domNode.setAttribute("height",this.imageHeight); } if(this.imageTooltip) { domNode.setAttribute("title",this.imageTooltip); diff --git a/editions/tw5.com/tiddlers/widgets/ImageWidget.tid b/editions/tw5.com/tiddlers/widgets/ImageWidget.tid index ebf65df72..dee19cadf 100644 --- a/editions/tw5.com/tiddlers/widgets/ImageWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ImageWidget.tid @@ -14,12 +14,14 @@ Any content of the `<$image>` widget is ignored. |!Attribute |!Description | |source |The URL of the image, or the title of an image tiddler | -|width |The width of the image as a number | +|width |The width of the image | |height |The height of the image | |tooltip |The tooltip to be displayed over the image | |alt |The alternative text to be associated with the image | |class |CSS classes to be assigned to the `` element | +The width and the height can be specified as pixel values (eg "23" or "23px") or percentages (eg "23%"). They are both optional; if not provided the browser will use CSS rules to size the image. + ! External Images and the ''_canonical_uri'' field When used to display tiddler-based images, the image widget operates in two distinct modes: