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