Skip to content

Commit 6c6531d

Browse files
committed
Code improvments after review
1 parent 1ed4deb commit 6c6531d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

static/canjs.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,13 @@ function navigate(href, updateLocation) {
445445
var $pathPrefixDiv = $content.filter("[path-prefix]");
446446

447447
// handle inline javascript code
448-
// create a steal module on the fly
448+
// define a steal module on the fly
449449
var scripts = $article[0].querySelectorAll('script[type="text/steal-module"]');
450450
if (scripts && scripts.length > 0 ) {
451-
$.each(scripts, function (i, script) {
452-
if (typeof steal !== 'undefined') {
453-
var moduleName = currentPage + "/" + i
454-
if (!steal.loader.has(moduleName)) {
455-
steal.loader.define(moduleName, script.innerText);
456-
}
451+
scripts.forEach(function (script, i) {
452+
var moduleName = currentPage + "/" + i
453+
if (!steal.loader.has(moduleName)) {
454+
steal.loader.define(moduleName, script.innerText);
457455
}
458456
});
459457
}

0 commit comments

Comments
 (0)