Skip to content

Commit

Permalink
Task 3333: Close button on maximixed console sample should close
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsharE committed Jun 12, 2024
1 parent 987c2f6 commit c8716b7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
9 changes: 6 additions & 3 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ kbd {
.cmd .cmd-bar {
display: flex;
background: #2e2e2e;
padding: 8px 12px 0px 8px;
padding: 8px 8px 0px 8px;
border-radius: 6px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
Expand All @@ -1463,7 +1463,7 @@ kbd {
margin-left: auto;
cursor: pointer;
align-items: center;
padding-bottom: 8px;
margin-bottom: 8px;
}
.cmd .cmd-bar .cmd-buttons i {
margin: 0 17px;
Expand All @@ -1483,7 +1483,10 @@ kbd {
margin: 0;
}
.cmd .cmd-bar .cmd-buttons i:last-child {
margin-right: 6px;
z-index: 999;
width: 45px;
text-align: center;
margin: 0;
font-size: 17px;
}
.cmd .cmd-bar .cmd-buttons i.btn-fullscreen-mode {
Expand Down
4 changes: 2 additions & 2 deletions assets/css/style.min.css

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ $(document).ready(function(){
if (e.currentTarget.parentElement.classList.contains('cmd-buttons')) {
var codeBlock = this.parentNode.parentNode.parentNode.cloneNode(true);
$('body').css('overflow', 'hidden');
codeBlock.querySelector('.cmd-buttons .fa-times').classList.add('btn-close-cmd');
$(fullScreenWindow).append(codeBlock);
$(fullScreenWindow).addClass('is-open is-console');
isFullScreenModeCodeOn = true;
Expand All @@ -97,6 +98,17 @@ $(document).ready(function(){
}
});


$('body').on('click', '.btn-close-cmd', function(e) {
e.stopPropagation();

if (isFullScreenModeCodeOn) {
$('body').css('overflow', '');
$(fullScreenWindow).removeClass('is-open is-console').empty();
isFullScreenModeCodeOn = false;
}
});

$(document).keyup(function(e) {
if($(fullScreenWindow).hasClass('is-open') && e.key === "Escape") {
$('body').css('overflow', '');
Expand Down Expand Up @@ -294,7 +306,7 @@ $(window).on('load', function() {
$().fancybox({
selector: '[data-bsod]',
beforeLoad: function(instance, current) {
if(current.src === "https://blog.elmah.io/content/images/2019/12/bsod.png") {
if (current.src === "https://blog.elmah.io/content/images/2019/12/bsod.png") {
$(instance.$refs.container[0]).addClass('fancybox-bsod');
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/main.min.js.map

Large diffs are not rendered by default.

0 comments on commit c8716b7

Please sign in to comment.