2016-06-18 23:44:36 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
|
|
});
|
|
|
|
|
2017-10-13 04:14:47 +02:00
|
|
|
// open recipe window if a hash is found in URL
|
2016-06-18 23:44:36 +02:00
|
|
|
if(window.location.hash) {
|
2017-10-13 04:14:47 +02:00
|
|
|
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>");
|
2016-06-18 23:44:36 +02:00
|
|
|
}
|
|
|
|
|
2017-10-13 04:14:47 +02:00
|
|
|
// 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>");
|
2016-06-18 23:44:36 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|