mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-01-27 10:25:01 +01:00
patches link to command javascript
This commit is contained in:
parent
8cce1275a8
commit
c18a193973
14
js/js.js
14
js/js.js
@ -2,19 +2,19 @@ $(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.substring(1)
|
id = window.location.hash
|
||||||
document.getElementById(id).checked = true;
|
document.getElementById(id.substring(1)).checked = true;
|
||||||
$('html, body').animate({ scrollTop: $(window.location.hash).offset().top}, 1000);
|
$('html, body').animate({ scrollTop: $(id).offset().top}, 1000);
|
||||||
$(id + " .link").empty();
|
$(id).closest('div').find('.link').empty();
|
||||||
$(id + " .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="+window.location.href+">"+window.location.href+"</a></small>");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add hash URL when recipe is opened
|
// add hash URL when recipe is opened
|
||||||
$('label[class="recipe"]').on("click", function(){
|
$('label[class="recipe"]').on("click", function(){
|
||||||
id = $(this).attr("for");
|
id = $(this).attr("for");
|
||||||
window.location.hash = id
|
window.location.hash = id
|
||||||
$(id + " .link").empty();
|
$(id).closest('div').find('.link').empty();
|
||||||
$(id + " .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="+window.location.href+">"+window.location.href+"</a></small>");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user