modals go inline instead of popup

This commit is contained in:
Ashley Blewer 2017-10-12 22:14:47 -04:00
parent 77c31a7c5c
commit b1f7f5cad4
2 changed files with 1553 additions and 2053 deletions

3578
index.html

File diff suppressed because it is too large Load Diff

View File

@ -4,25 +4,21 @@ $(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip()
});
// open modal window if a hash is found in URL
// open recipe window if a hash is found in URL
if(window.location.hash) {
$(window.location.hash).modal('show');
// add direct link to modal window
$(".link").empty();
$(".link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
id = window.location.hash
$(id).collapse('show');
$('html, body').animate({ scrollTop: $(id).offset().top}, 1000);
$(id + " .link").empty();
$(id + " .link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
}
// add hash to URL when modal is opened
$('span[data-toggle="modal"]').on("click", function(){
window.location.hash = $(this).attr("data-target");
// add direct link to modal window
$(".link").empty();
$(".link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
});
// remove hash from URL when modal is closed
$(document).on('hide.bs.modal', function (e) {
history.pushState("", document.title, window.location.pathname);
// add hash URL when recipe is opened
$('span[data-toggle="collapse"]').on("click", function(){
id = $(this).attr("data-target");
window.location.hash = id
$(id + " .link").empty();
$(id + " .link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
});
});