Minor fixes for chrome compatibility
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 2eb7a7c..5d18d45 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -115,13 +115,16 @@
%= javascript begin
-$("ol > li:not(.active)").on("click", function () {
+$("#search > ol > li:not(.active)").on("click", function (e) {
$(this).addClass('active');
+ e.stopPropagation();
});
-function closeSnippet (o) {
- $(o.parentNode.parentNode).removeClass('active');
-};
+$("#search > ol > li:not(.active) > ul > li.close").on("click", function (e) {
+ $(this.parentNode.parentNode).removeClass('active');
+ e.stopPropagation();
+});
+
function showTable (o) {
var match = o.parentNode.parentNode;
@@ -137,9 +140,9 @@
};
var corpusID = match.getAttribute('data-corpus-id');
- var docID = match.getAttribute('data-doc-id');
- var matchID = match.getAttribute('data-match-id');
- var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
+ var docID = match.getAttribute('data-doc-id');
+ var matchID = match.getAttribute('data-match-id');
+ var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
var snippet;
jQuery.getJSON(url, function (res) {
@@ -169,7 +172,7 @@
closeTutorial();
};
-$("code.query.serial,#sidebar").on("click", function () {
+$("code.query.serial, #sidebar").on("click", function () {
$(this).toggleClass('active');
});
diff --git a/templates/search.html.ep b/templates/search.html.ep
index c393c72..091fd39 100644
--- a/templates/search.html.ep
+++ b/templates/search.html.ep
@@ -35,7 +35,7 @@
as <%= $_->{docID} %> (<%= $_->{corpusID} %>)
</p>
<ul class="action right">
- <li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></i></li>
+ <li class="close" title="close"><i class="fa fa-toggle-up"></i></li>
<li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
<!--
<li title="Tree Visualizations"><i class="fa fa-sitemap"></i></li>