Commit 40bd60d6 by swdanielli

underscore doesn't work in lms

parent a606d00b
......@@ -936,7 +936,6 @@ class RecommenderXBlock(HelperXBlock):
frag.add_css(self.resource_string("static/css/tooltipster.css"))
frag.add_css(self.resource_string("static/css/recommender.css"))
frag.add_css(self.resource_string("static/css/introjs.css"))
frag.add_javascript(self.resource_string("static/js/src/underscore-min.js"))
frag.add_javascript(self.resource_string("static/js/src/jquery.tooltipster.min.js"))
frag.add_javascript(self.resource_string("static/js/src/cats.js"))
frag.add_javascript(self.resource_string("static/js/src/recommender.js"))
......
......@@ -116,7 +116,7 @@
<%include file="resourcebox.html" args="id=elem['id'],title=elem['title'],votes=elem['votes'],url=elem['url'],description=elem['description'],descriptionText=elem['descriptionText'],isProblematic=flag_mode,problematicReason=reason,voteMode=vote_mode,endorseMode=endorse_mode,endorsedReason=endorsed_reason" />
% endfor
</div>
<div class="recommender_resourceAddButton" role="button" tabindex="0">Add new resource &gt;&gt;</div>
<div class="recommender_resourceAddButton" role="button" tabindex="0">Addqq new resource &gt;&gt;</div>
<div class="recommender_resourceExportButton" role="button" tabindex="0">Download resources</div>
<div class="recommender_resourceImportButton" role="button" style='display: none;' tabindex="0" aria-hidden="true">Upload resources</div>
<div class="recommender_clearFix"></div>
......
......@@ -27,10 +27,16 @@ function RecommenderXBlock(runtime, element, init_data) {
* @returns {dictionary} The dictionary for logging an event.
*/
function generateLog(status, information) {
return _.find([
{'status': status, 'element': $(element).attr('data-usage-id')},
{'status': status, 'element': $(element).attr('data-usage-id'), 'information': information}
], function(log) { return information === log.information; });
if (!information) {
return { 'status': status, 'element': $(element).attr('data-usage-id') };
}
else {
return {
'status': status,
'information': information,
'element': $(element).attr('data-usage-id')
}
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment