ffmprovisr/js/js.js

21 lines
780 B
JavaScript
Raw Normal View History

$(document).ready(function() {
2017-10-13 04:14:47 +02:00
// open recipe window if a hash is found in URL
if(window.location.hash) {
id = window.location.hash.substring(1)
document.getElementById(id).checked = true;
$('html, body').animate({ scrollTop: $(window.location.hash).offset().top}, 1000);
2017-10-13 04:14:47 +02:00
$(id + " .link").empty();
$(id + " .link").append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
}
2017-10-13 04:14:47 +02:00
// add hash URL when recipe is opened
$('label[class="recipe"]').on("click", function(){
id = $(this).attr("for");
2017-10-13 04:14:47 +02:00
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>");
});
});