mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-01-12 11:37:08 +01:00
modals go inline instead of popup
This commit is contained in:
parent
77c31a7c5c
commit
b1f7f5cad4
1024
index.html
1024
index.html
File diff suppressed because it is too large
Load Diff
28
js/js.js
28
js/js.js
@ -4,25 +4,21 @@ $(document).ready(function() {
|
|||||||
$('[data-toggle="tooltip"]').tooltip()
|
$('[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) {
|
if(window.location.hash) {
|
||||||
$(window.location.hash).modal('show');
|
id = window.location.hash
|
||||||
// add direct link to modal window
|
$(id).collapse('show');
|
||||||
$(".link").empty();
|
$('html, body').animate({ scrollTop: $(id).offset().top}, 1000);
|
||||||
$(".link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
|
$(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
|
// add hash URL when recipe is opened
|
||||||
$('span[data-toggle="modal"]').on("click", function(){
|
$('span[data-toggle="collapse"]').on("click", function(){
|
||||||
window.location.hash = $(this).attr("data-target");
|
id = $(this).attr("data-target");
|
||||||
// add direct link to modal window
|
window.location.hash = id
|
||||||
$(".link").empty();
|
$(id + " .link").empty();
|
||||||
$(".link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
|
$(id + " .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);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user