Skip to content

Commit 58a9be9

Browse files
committed
Change to using css classes for simple-modal container so it can be embedded within a unique div in the case where we have multiple of these question types on a page.
1 parent 4cec129 commit 58a9be9

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

v3/css/basic.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
* Revision: $Id: basic.css 257 2010-07-27 23:06:56Z emartin24 $
1212
*/
1313

14-
#basic-modal-content {display:none;}
14+
.basic-modal-content {display:none;}
1515

1616
/* Overlay */
1717
#simplemodal-overlay {background-color:#000; cursor:wait;}
1818

1919
/* Container */
20-
#simplemodal-container {height:360px; width:600px; color:#bbb; background-color:#333; border:4px solid #444; padding:12px;}
21-
#simplemodal-container .simplemodal-data {padding:8px;}
22-
#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;}
23-
#simplemodal-container a {color:#ddd;}
24-
#simplemodal-container a.modalCloseImg {background:url(x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
25-
#simplemodal-container h3 {color:#84b8d9;}
20+
.simplemodal-container {height:360px; width:600px; color:#bbb; background-color:#333; border:4px solid #444; padding:12px;}
21+
.simplemodal-container .simplemodal-data {padding:8px;}
22+
.simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;}
23+
.simplemodal-container a {color:#ddd;}
24+
.simplemodal-container a.modalCloseImg {background:url(x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
25+
.simplemodal-container h3 {color:#84b8d9;}

v3/embedding-demo.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232

3333
<!-- This demo shows three visualizations, each embedded within a div ... -->
3434
<div id="bradsDiv"></div>
35-
<div id="basic-modal-content">
35+
36+
<div id="bradsDiv_modal" class="basic-modal-content">
3637
Enter the value of the variable a after the current line is executed.
3738
<input id="basic-textbox" type="textbox" />
3839
<button onclick="checkMe('basic-textbox','bradsDiv','globals.a')">Check

v3/embedding-demo.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v3/js/pytutor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,8 @@ ExecutionVisualizer.prototype.updateOutput = function(smoothTransition) {
11201120
// bnm Render a question
11211121
if (curEntry.question) {
11221122
//alert(curEntry.question.text);
1123-
$('#basic-modal-content').modal();
1123+
1124+
$('#'+curEntry.question.div).modal();
11241125
}
11251126

11261127
// render VCR controls:
@@ -2934,11 +2935,11 @@ function checkMe(inputId, divId, answer) {
29342935
for (j in attrs) {
29352936
correctAns = correctAns[attrs[j]]
29362937
}
2937-
feedbackElement = $("#basic-modal-content .feedbacktext")
2938+
feedbackElement = $(".basic-modal-content .feedbacktext")
29382939
if (ans == correctAns) {
29392940
feedbackElement.html('Correct')
29402941
} else {
2941-
feedbackElement.html('In-Correct')
2942+
feedbackElement.html('Incorrect')
29422943
}
29432944

29442945
}

0 commit comments

Comments
 (0)