Commit 13470be7 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Menu doesn't close by clicking on the free space.

parent e088fa14
...@@ -57,15 +57,15 @@ ...@@ -57,15 +57,15 @@
<div class="pull-right list-view-controls"> <div class="pull-right list-view-controls">
<div class="btn-group" id="displayColumns"> <div class="btn-group" id="displayColumns">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="dropdown form-horizontal" id="selectColumns"> <li class="dropdown form-horizontal js-dropdown" id="selectColumns">
<a class="dropdown-toggle btn btn-default" href="#"> <a class="dropdown-toggle btn btn-default" href="#">
<b class="glyphicon glyphicon-th-list"></b> <b class="glyphicon glyphicon-th-list"></b>
<spring:message code="columns.add"/> <spring:message code="columns.add"/>
</a> </a>
<ul class="dropdown-menu view-columns"> <ul class="dropdown-menu view-columns">
<li> <li>
<a id="columnsApply" style="margin-bottom: 10px" type="submit" <a id="columnsApply" style="margin-bottom: 10px" type="submit" class="btn btn-default">
+ class="btn btn-default"><spring:message code="columns.apply"/> <spring:message code="columns.apply"/>
</a> </a>
</li> </li>
<li class="dropdown-header"> <li class="dropdown-header">
...@@ -76,12 +76,10 @@ ...@@ -76,12 +76,10 @@
<label class="column-enable" for="cb-${columnName}"> <label class="column-enable" for="cb-${columnName}">
<c:choose> <c:choose>
<c:when test="${selectedColumns.contains(columnName)}"> <c:when test="${selectedColumns.contains(columnName)}">
<input id="cb-${columnName}" type="checkbox" <input id="cb-${columnName}" type="checkbox" name="${columnName}" checked />
+ checked="checked" name="${columnName}"/>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<input id="cb-${columnName}" type="checkbox" <input id="cb-${columnName}" type="checkbox" name="${columnName}"/>
+ name="${columnName}"/>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<spring:message code="accession.${columnName}"/> <spring:message code="accession.${columnName}"/>
...@@ -94,8 +92,7 @@ ...@@ -94,8 +92,7 @@
</div> </div>
<div class="btn-group" id="shareLink"> <div class="btn-group" id="shareLink">
<a type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" <a type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="menuShareLink">
aria-haspopup="true" aria-expanded="false" id="menuShareLink">
<span class="glyphicon glyphicon-share"></span> <span class="glyphicon glyphicon-share"></span>
<span><spring:message code="share.link"/></span> <span><spring:message code="share.link"/></span>
<span class="caret"></span> <span class="caret"></span>
...@@ -103,8 +100,7 @@ ...@@ -103,8 +100,7 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li class="padding10"> <li class="padding10">
<p><spring:message code="share.link.text"/></p> <p><spring:message code="share.link.text"/></p>
<input id="shortLink" type="text" <input id="shortLink" placeholder="<spring:message code="share.link.placeholder" />" value=""/>
placeholder="<spring:message code="share.link.placeholder" />" value=""/>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -577,6 +573,7 @@ ...@@ -577,6 +573,7 @@
}); });
$("#menuShareLink").on("click", function () { $("#menuShareLink").on("click", function () {
$("#selectColumns").removeClass('open');
if ($('#shortLink').val() === '') { if ($('#shortLink').val() === '') {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -646,6 +643,13 @@ ...@@ -646,6 +643,13 @@
</c:forEach> </c:forEach>
}); });
$(document).bind('click', function(e) {
var clicked = $(e.target);
if (!clicked.parents().hasClass('view-columns') && !clicked.parents().hasClass('js-dropdown')) {
$('#selectColumns').removeClass('open');
}
});
$('li#selectColumns a').on('click', function (event) { $('li#selectColumns a').on('click', function (event) {
event.preventDefault(); event.preventDefault();
$(this).parent().toggleClass('open'); $(this).parent().toggleClass('open');
......
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