Index: lams_central/web/includes/javascript/addLesson.js
===================================================================
diff -u -r33f9914fba416faeaa89be285fa2cd182c4d29ed -rf14dd6ce1f03d0ce6d3914ea1d009cee059cc41b
--- lams_central/web/includes/javascript/addLesson.js (.../addLesson.js) (revision 33f9914fba416faeaa89be285fa2cd182c4d29ed)
+++ lams_central/web/includes/javascript/addLesson.js (.../addLesson.js) (revision f14dd6ce1f03d0ce6d3914ea1d009cee059cc41b)
@@ -482,17 +482,20 @@
generatingLearningDesign = true;
// iframe just to load Authoring for a single purpose, generate the SVG
- $('').appendTo('body').load(function(){
+ $('').appendTo('body').css('visibility', 'hidden').load(function(){
// call svgGenerator.jsp code to store LD SVG on the server
var frame = $(this),
win = frame[0].contentWindow || frame[0].contentDocument;
- win.GeneralLib.saveLearningDesignImage();
- frame.remove();
- // load the image again, avoid caching
- loadLearningDesignSVG(ldId);
- }).attr('src', LAMS_URL
- + 'authoring/generateSVG.do?selectable=false&learningDesignID='
- + ldId);
+ // when LD opens, make a callback which save the thumbnail and displays it in current window
+ win.GeneralLib.openLearningDesign(ldId, function(){
+ result = win.GeneralLib.saveLearningDesignImage();
+ frame.remove();
+ if (result) {
+ // load the image again
+ loadLearningDesignSVG(ldId);
+ }
+ });
+ }).attr('src', LAMS_URL + 'authoring/generateSVG.do?selectable=false');
}
});