Fix SVG size for Hotspot and Annotation exercises - refs BT#12966

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent f334d26842
commit b82a2ddfc0
  1. 4
      main/inc/lib/javascript/annotation/js/annotation.js
  2. 36
      main/inc/lib/javascript/hotspot/js/hotspot.js

@ -183,8 +183,8 @@
this.el = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
this.el.style.width = this.image.width + 'px';
this.el.style.height = this.image.height + 'px';
this.el.setAttribute('width', this.image.width);
this.el.setAttribute('height', this.image.height);
var svgImage = document.createElementNS('http://www.w3.org/2000/svg', 'image');
svgImage.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);

@ -504,6 +504,8 @@ window.HotspotQuestion = (function () {
AdminHotspotsSVG.prototype.render = function () {
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
this.el.setAttribute('width', this.image.width);
this.el.setAttribute('height', this.image.height);
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@ -802,6 +804,8 @@ window.HotspotQuestion = (function () {
UserHotspotsSVG.prototype.render = function () {
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
this.el.setAttribute('width', this.image.width);
this.el.setAttribute('height', this.image.height);
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@ -1018,6 +1022,8 @@ window.HotspotQuestion = (function () {
SolutionHotspotsSVG.prototype.render = function () {
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
this.el.setAttribute('width', this.image.width);
this.el.setAttribute('height', this.image.height);
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@ -1430,11 +1436,13 @@ window.DelineationQuestion = (function () {
this.render = function () {
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
imageSvg.setAttributeNS(null, 'width', image.width);
imageSvg.setAttributeNS(null, 'height', image.height);
imageSvg.setAttribute('width', image.width);
imageSvg.setAttribute('height', image.height);
this.el.setAttributeNS(null, 'version', '1.1');
this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('width', image.width);
this.el.setAttribute('height', image.height);
this.el.appendChild(imageSvg);
var isDrawing = false;
@ -1550,11 +1558,13 @@ window.DelineationQuestion = (function () {
this.render = function () {
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
imageSvg.setAttributeNS(null, 'width', image.width);
imageSvg.setAttributeNS(null, 'height', image.height);
imageSvg.setAttribute('width', image.width);
imageSvg.setAttribute('height', image.height);
this.el.setAttributeNS(null, 'version', '1.1');
this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('width', image.width);
this.el.setAttribute('height', image.height);
this.el.appendChild(imageSvg);
this.renderDelineation();
@ -1675,11 +1685,13 @@ window.DelineationQuestion = (function () {
this.render = function () {
var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
imageSvg.setAttributeNS(null, 'width', image.width);
imageSvg.setAttributeNS(null, 'height', image.height);
imageSvg.setAttribute('width', image.width);
imageSvg.setAttribute('height', image.height);
this.el.setAttributeNS(null, 'version', '1.1');
this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('version', '1.1');
this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
this.el.setAttribute('width', image.width);
this.el.setAttribute('height', image.height);
this.el.appendChild(imageSvg);
};

Loading…
Cancel
Save