From 50dc661699a3e63d0c303828d3ea0f9c25e3fff5 Mon Sep 17 00:00:00 2001 From: Ram Jayaraman Date: Thu, 19 Jul 2018 14:20:20 +0530 Subject: [PATCH 1/2] Fixed dependency on background image for accessing the image source. Passing the image source directly to the function instead. --- renderer/js/mtftemplate.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/renderer/js/mtftemplate.js b/renderer/js/mtftemplate.js index 8bc438f..e692a5c 100644 --- a/renderer/js/mtftemplate.js +++ b/renderer/js/mtftemplate.js @@ -20,7 +20,7 @@ MTFController.getQuestionContent = function () { return "
\
\ <% if(question.data.question.image){ %> \ - \ + \ <%}else{ %> \ <% } %> \
\ @@ -48,7 +48,7 @@ MTFController.getHorizontalLayout = function () {
\
\
\ -

);\">\ +

);\">\ \<%= val.text %>\ <% if(val.audio){ %> \ \ @@ -79,7 +79,7 @@ MTFController.getHorizontalLayout = function () {

\
\
<% if(MTFController.selAns[key].selText < 1){ %>\ -

');\">\ +

');\">\ <%= val.text %>\ <% if(val.audio){ %> \ \ @@ -107,7 +107,7 @@ MTFController.getVerticalLayout = function () {

\
\
\ -

);\">\ +

);\">\ \<%= val.text %>\ <% if(val.audio){ %> \ \ @@ -138,7 +138,7 @@ MTFController.getVerticalLayout = function () {

\
\
<% if(MTFController.selAns[key].selText < 1){ %>\ -

');\">\ +

');\">\ <% if(val.audio){ %> \ \ ' onclick=MTFController.pluginInstance.playAudio({src:'<%= val.audio %>'}) \>\ @@ -159,14 +159,7 @@ MTFController.getVerticalLayout = function () { * image will be shown in popup * @memberof org.ekstep.questionunit.mtf.mtftemplate */ -MTFController.showImageModel = function (event, imageSrcType) { - var eventData; - if (imageSrcType == "background-image") { - eventData = event.target.style.backgroundImage.slice(4, -1).replace(/"/g, ""); - if (!eventData) return false; //when there is no image option - } else { - eventData = event.target.src; - } +MTFController.showImageModel = function (event, imageSrc) { var modelTemplate = "