#26246: merge with 3.4.
This commit is contained in:
commit
738f88f688
|
@ -38,20 +38,24 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// define the behavior of the button when it's clicked
|
// define the behavior of the button when it's clicked
|
||||||
$('.copybutton').toggle(
|
$('.copybutton').click(function(e){
|
||||||
function() {
|
e.preventDefault();
|
||||||
var button = $(this);
|
var button = $(this);
|
||||||
|
if (button.data('hidden') === 'false') {
|
||||||
|
// hide the code output
|
||||||
button.parent().find('.go, .gp, .gt').hide();
|
button.parent().find('.go, .gp, .gt').hide();
|
||||||
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
|
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
|
||||||
button.css('text-decoration', 'line-through');
|
button.css('text-decoration', 'line-through');
|
||||||
button.attr('title', show_text);
|
button.attr('title', show_text);
|
||||||
},
|
button.data('hidden', 'true');
|
||||||
function() {
|
} else {
|
||||||
var button = $(this);
|
// show the code output
|
||||||
button.parent().find('.go, .gp, .gt').show();
|
button.parent().find('.go, .gp, .gt').show();
|
||||||
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
|
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
|
||||||
button.css('text-decoration', 'none');
|
button.css('text-decoration', 'none');
|
||||||
button.attr('title', hide_text);
|
button.attr('title', hide_text);
|
||||||
});
|
button.data('hidden', 'false');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue