Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set whether bluescreen panel is collapsed or not #232

Merged
merged 1 commit into from Oct 30, 2016

Conversation

@EdaCZ
Copy link
Contributor

EdaCZ commented Oct 30, 2016

Purpose of this pull request is to give user-defined panels in bluescreen possibility to declare whether they want to be collapsed or expanded.

Now, if you implement Bluescreen panel, you must return from your callback array with two keys - panel and tab. After this PR we will support third optional key - collapsed.

@@ -193,10 +193,11 @@ $code = $exception->getCode() ? ' #' . $exception->getCode() : '';
<?php $bottomPanels = [] ?>
<?php foreach ($this->renderPanels(NULL) as $panel): ?>
<?php if (!empty($panel->bottom)) { $bottomPanels[] = $panel; continue; } ?>
<?php $collapsed = isset($panel->collapsed) ? (bool) $panel->collapsed : true; ?>

This comment has been minimized.

Copy link
@JanTvrdik

JanTvrdik Oct 30, 2016

Contributor

the (bool) cast is unnecessary; true should be written in uppercase (TRUE)

This comment has been minimized.

Copy link
@dg

dg Oct 30, 2016

Member

Maybe it is better to create $collapseClass than bool $collapse

This comment has been minimized.

Copy link
@EdaCZ

EdaCZ Oct 30, 2016

Author Contributor

Bool cast removed.

Used $collapseClass.

@EdaCZ EdaCZ force-pushed the EdaCZ:master branch from e65c56a to 6a38f86 Oct 30, 2016
@@ -193,10 +193,11 @@ $code = $exception->getCode() ? ' #' . $exception->getCode() : '';
<?php $bottomPanels = [] ?>
<?php foreach ($this->renderPanels(NULL) as $panel): ?>
<?php if (!empty($panel->bottom)) { $bottomPanels[] = $panel; continue; } ?>
<?php $collapsedClass = (isset($panel->collapsed) ? $panel->collapsed : TRUE) ? ' tracy-collapsed' : ''; ?>

This comment has been minimized.

Copy link
@JanTvrdik

JanTvrdik Oct 30, 2016

Contributor

Can be simplified to

$collapsedClass = !isset($panel->collapsed) || $panel->collapsed ? ' tracy-collapsed' : '';

This comment has been minimized.

Copy link
@EdaCZ

EdaCZ Oct 30, 2016

Author Contributor

Done.

Anything else? :-)

@EdaCZ EdaCZ force-pushed the EdaCZ:master branch from 6a38f86 to 73fd753 Oct 30, 2016
@dg dg merged commit d8eaf19 into nette:master Oct 30, 2016
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dg

This comment has been minimized.

Copy link
Member

dg commented Oct 30, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.