From 2f5f6293a25657d2418c52c2eded01ef2b8ed9aa Mon Sep 17 00:00:00 2001 From: Jaanus Vapper Date: Mon, 31 Oct 2022 15:22:35 +0200 Subject: [PATCH] Make logo act as close button (#451) Co-authored-by: Jaanus Vapper --- src/DebugBar/Resources/debugbar.css | 3 +-- src/DebugBar/Resources/debugbar.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DebugBar/Resources/debugbar.css b/src/DebugBar/Resources/debugbar.css index 502d248..606e51d 100644 --- a/src/DebugBar/Resources/debugbar.css +++ b/src/DebugBar/Resources/debugbar.css @@ -116,11 +116,10 @@ div.phpdebugbar-closed, div.phpdebugbar-minimized{ } /* -------------------------------------- */ -div.phpdebugbar-header, a.phpdebugbar-restore-btn { +a.phpdebugbar-restore-btn { background: #efefef url(data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23000%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M6.039%208.342c.463%200%20.772.084.927.251.154.168.191.455.11.862-.084.424-.247.727-.487.908-.241.182-.608.272-1.1.272h-.743l.456-2.293h.837zm-2.975%204.615h1.22l.29-1.457H5.62c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.13-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H4.153l-1.089%205.479zM9.235%206.02h1.21l-.289%201.458h1.079c.679%200%201.147.115%201.405.347.258.231.335.607.232%201.125l-.507%202.55h-1.23l.481-2.424c.055-.276.035-.464-.06-.565-.095-.1-.298-.15-.608-.15H9.98L9.356%2011.5h-1.21l1.089-5.48M15.566%208.342c.464%200%20.773.084.928.251.154.168.19.455.11.862-.084.424-.247.727-.488.908-.24.182-.607.272-1.1.272h-.742l.456-2.293h.836zm-2.974%204.615h1.22l.29-1.457h1.046c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.129-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H13.68l-1.089%205.479z%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fsvg%3E) no-repeat 5px 4px / 20px 20px; } div.phpdebugbar-header { - padding-left: 29px; min-height: 26px; line-height: 16px; } diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index 144b3f5..c45455a 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -477,6 +477,10 @@ if (typeof(PhpDebugBar) == 'undefined') { this.$dragCapture = $('
').addClass(csscls('drag-capture')).appendTo(this.$el); this.$resizehdle = $('
').addClass(csscls('resize-handle')).appendTo(this.$el); this.$header = $('
').addClass(csscls('header')).appendTo(this.$el); + this.$headerBtn = $('').addClass(csscls('restore-btn')).appendTo(this.$header); + this.$headerBtn.click(function() { + self.close(); + }); this.$headerLeft = $('
').addClass(csscls('header-left')).appendTo(this.$header); this.$headerRight = $('
').addClass(csscls('header-right')).appendTo(this.$header); var $body = this.$body = $('
').addClass(csscls('body')).appendTo(this.$el);