Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Fix ESC and Modal Close correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Alipoodle committed Sep 9, 2019
1 parent 2a849a5 commit 0856473
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -76,7 +76,7 @@ <h5>Search for a Bug Report</h5>
<button class="button" onclick="searchTrello(true)">Next page</button>
</div>

<div class="reveal" id="trello-modal" data-reveal>
<div class="reveal" id="trello-modal" data-close-on-esc="false" data-reveal>
<h4>Please enter your Trello Key + Token</h4>
<dl>
<dt>Enter Key + Token</dt>
Expand Down Expand Up @@ -106,7 +106,7 @@ <h4>Please enter your Trello Key + Token</h4>
</button>
</div>

<div class="reveal" id="card-modal" data-reveal-id="card-modal" data-reveal>
<div class="reveal" id="card-modal" data-reveal-id="card-modal" data-close-on-esc="false" data-reveal>
<div id="card">
<h4 id="card-title"></h4>
<h6>Board: <span id="card-board"></span></h6>
Expand Down
12 changes: 8 additions & 4 deletions js/bugsearch.js
Expand Up @@ -25,8 +25,12 @@
e.stopPropagation();
history.back()
});



$('body').on('click', function (e) {
if (e.target == $('div.reveal-overlay[style^=display]')[0]) {
$modals = $('div.reveal-overlay');
if (e.target == $modals[1]) {
e.preventDefault();
e.stopPropagation();
history.back();
Expand Down Expand Up @@ -65,7 +69,7 @@ function keySearch(evt) {
var pageNum = 0;
function searchTrello(newPage) {
newPage = newPage || false;

var query = $('#search-field').val();
if (query.trim() == "") { return; }

Expand Down Expand Up @@ -153,9 +157,9 @@ function formatAttachments(attachments) {
attachments.forEach(function(attachment, i) {
var youtubeURL = attachment.url.match('^(https?://)?(www.)?(youtube.com|youtu.?be)/.+$')
if (youtubeURL) {
htmlAttachments.push('<a href="' + encodeURI(attachment.url) + '">Video '+(i+1)+'</a>');
htmlAttachments.push('<a target="_blank" href="' + encodeURI(attachment.url) + '">Video '+(i+1)+'</a>');
} else {
htmlAttachments.push('<a href="' + encodeURI(attachment.url) + '">Image '+(i+1)+'</a>');
htmlAttachments.push('<a target="_blank" href="' + encodeURI(attachment.url) + '">Image '+(i+1)+'</a>');
}
})
return htmlAttachments;
Expand Down

0 comments on commit 0856473

Please sign in to comment.