Skip to content

Commit

Permalink
add module for proper rendering of latex in lit search results
Browse files Browse the repository at this point in the history
Signed-off-by: Dinika <dinika.saxena@cern.ch>
  • Loading branch information
Dinika authored and jmartinm committed Dec 4, 2017
1 parent c835d53 commit 0e630e1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/inspirehep-mathjax/inspirehepMathjax.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(function (angular) {

function MathjaxController($scope, $window) {

function requestMathjax() {
setTimeout(function() {
$window.MathJax.Hub.Queue(['Typeset', $window.MathJax.Hub]);
});
}

$scope.$on('invenio.search.success', requestMathjax);
}

MathjaxController.$inject = ['$scope', '$window'];

angular.module('inspirehepMathjax.controllers', [])
.controller('MathjaxController', MathjaxController);

})(angular);
7 changes: 7 additions & 0 deletions src/inspirehep-mathjax/inspirehepMathjax.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function (angular) {

angular.module('inspirehepMathjax', [
'inspirehepMathjax.controllers'
]);

})(angular);
1 change: 1 addition & 0 deletions src/inspirehep.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'inspirehepHoldingpen',
'inspirehepFacetsShowMore',
'inspirehepExport',
'inspirehepMathjax',
'inspirehepSearch.filters',
'inspirehepSearchTemplates',
'ui.bootstrap',
Expand Down

0 comments on commit 0e630e1

Please sign in to comment.