mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2024-12-25 19:28:21 +01:00
Merge pull request #285 from amiaopensource/link-to-site-locally
links to website permalink even when loading locally
This commit is contained in:
commit
d71793583e
5
js/js.js
5
js/js.js
@ -3,10 +3,11 @@ $(document).ready(function() {
|
|||||||
// open recipe 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) {
|
||||||
id = window.location.hash
|
id = window.location.hash
|
||||||
|
console.log(id.substring(1))
|
||||||
document.getElementById(id.substring(1)).checked = true;
|
document.getElementById(id.substring(1)).checked = true;
|
||||||
$('html, body').animate({ scrollTop: $(id).offset().top}, 1000);
|
$('html, body').animate({ scrollTop: $(id).offset().top}, 1000);
|
||||||
$(id).closest('div').find('.link').empty();
|
$(id).closest('div').find('.link').empty();
|
||||||
$(id).closest('div').find('.link').append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
|
$(id).closest('div').find('.link').append("<small>Link to this command: <a href='https://amiaopensource.github.io/ffmprovisr/index.html"+window.location.hash+"'>https://amiaopensource.github.io/ffmprovisr/index.html"+window.location.hash+"</a></small>");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add hash URL when recipe is opened
|
// add hash URL when recipe is opened
|
||||||
@ -14,7 +15,7 @@ $(document).ready(function() {
|
|||||||
id = $(this).attr("for");
|
id = $(this).attr("for");
|
||||||
window.location.hash = ('#' + id)
|
window.location.hash = ('#' + id)
|
||||||
$('#' + id).closest('div').find('.link').empty();
|
$('#' + id).closest('div').find('.link').empty();
|
||||||
$('#' + id).closest('div').find('.link').append("<small>Link to this command: <a href="+window.location.href+">"+window.location.href+"</a></small>");
|
$('#' + id).closest('div').find('.link').append("<small>Link to this command: <a href='https://amiaopensource.github.io/ffmprovisr/index.html"+window.location.hash+"'>https://amiaopensource.github.io/ffmprovisr/index.html"+window.location.hash+"</a></small>");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user