Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-vectordraw
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-vectordraw
Commits
d2d0e84d
Commit
d2d0e84d
authored
Nov 25, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Studio: Make exercise preview render correctly on page load.
parent
d2fe0450
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
vectordraw/public/js/vectordraw.js
+13
-0
No files found.
vectordraw/public/js/vectordraw.js
View file @
d2d0e84d
...
...
@@ -606,11 +606,24 @@ function VectorDrawXBlock(runtime, element, init_args) {
.
success
(
updateStatus
);
}
// Logic for dealing with rendering issues
function
reRender
()
{
JXG
.
JSXGraph
.
freeBoard
(
vectordraw
.
board
);
vectordraw
.
render
();
}
// Initialization logic
// Initialize exercise
var
vectordraw
=
new
VectorDraw
(
'vectordraw'
,
init_args
.
settings
);
// Check if board was initialized successfully;
// if not, re-render the exercise:
if
(
vectordraw
.
board
.
canvasWidth
===
0
&&
vectordraw
.
board
.
canvasHeight
===
0
)
{
window
.
setTimeout
(
reRender
,
1
);
}
// Load user state
if
(
!
_
.
isEmpty
(
init_args
.
user_state
))
{
vectordraw
.
setState
(
init_args
.
user_state
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment