From c7dcb0bb57dd3ce0ec39c67e4e3eb2c298361971 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Thu, 17 Oct 2013 16:24:04 -0400 Subject: [PATCH] Attach image_input_click function to window object So other parts of the page can access it --- common/lib/xmodule/xmodule/js/src/capa/imageinput.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/capa/imageinput.js b/common/lib/xmodule/xmodule/js/src/capa/imageinput.js index 173cb50f54..d728c0522d 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/imageinput.js +++ b/common/lib/xmodule/xmodule/js/src/capa/imageinput.js @@ -1,15 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// // -// Simple image input +// Simple image input // //////////////////////////////////////////////////////////////////////////////// // click on image, return coordinates // put a dot at location of click, on imag -// window.image_input_click = function(id,event){ - -function image_input_click(id,event){ +window.image_input_click = function(id,event){ iidiv = document.getElementById("imageinput_"+id); pos_x = event.offsetX?(event.offsetX):event.pageX-iidiv.offsetLeft; pos_y = event.offsetY?(event.offsetY):event.pageY-iidiv.offsetTop; @@ -21,4 +19,4 @@ function image_input_click(id,event){ document.getElementById("cross_"+id).style.top = cy; document.getElementById("cross_"+id).style.visibility = "visible" ; document.getElementById("input_"+id).value =result; -} +};