Skip to content
Permalink
Browse files

bar: replaced attribute 'rel' with 'data-tracy-action' for closing & …

…open-to-window links
  • Loading branch information...
dg committed Feb 18, 2019
1 parent fef8f64 commit 10a04117da1d6279166c5d62f2f70e0be56eccee
@@ -62,9 +62,9 @@

elem.querySelectorAll('.tracy-icons a').forEach((link) => {
link.addEventListener('click', (e) => {
if (link.rel === 'close') {
if (link.dataset.tracyAction === 'close') {
this.toPeek();
} else if (link.rel === 'window') {
} else if (link.dataset.tracyAction === 'window') {
this.toWindow();
}
e.preventDefault();
@@ -258,7 +258,7 @@
initTabs(elem) {
elem.querySelectorAll('a').forEach((link) => {
link.addEventListener('click', (e) => {
if (link.rel === 'close') {
if (link.dataset.tracyAction === 'close') {
this.close();

} else if (link.rel) {
@@ -284,7 +284,7 @@
});

link.addEventListener('mouseenter', (e) => {
if (e.buttons || !link.rel || link.rel === 'close' || elem.classList.contains('tracy-dragged')) {
if (e.buttons || !link.rel || elem.classList.contains('tracy-dragged')) {
return;
}

@@ -311,7 +311,7 @@
link.addEventListener('mouseleave', () => {
clearTimeout(this.displayTimeout);

if (link.rel && link.rel !== 'close' && !elem.classList.contains('tracy-dragged')) {
if (link.rel && !elem.classList.contains('tracy-dragged')) {
Debug.panels[link.rel].blur();
}
});
@@ -32,6 +32,6 @@ namespace Tracy;
<?php } endforeach ?>

<?php if ($type === 'main'): ?>
<li><a href="#" rel="close" title="close debug bar">&times;</a></li>
<li><a href="#" data-tracy-action="close" title="close debug bar">&times;</a></li>
<?php endif ?>
</ul>
@@ -18,8 +18,8 @@ use Tracy\Helpers;
$icons = '
<div class="tracy-icons">
<a href="#" rel="window" title="open in window">&curren;</a>
<a href="#" rel="close" title="close window">&times;</a>
<a href="#" data-tracy-action="window" title="open in window">&curren;</a>
<a href="#" data-tracy-action="close" title="close window">&times;</a>
</div>
';
@@ -17,6 +17,6 @@ in file %a% on line %d%" data-tracy-href="editor:%a%"><span class="tracy-dump-st


<div class="tracy-icons">
<a href="#" rel="window" title="open in window">&curren;</a>
<a href="#" rel="close" title="close window">&times;</a>
<a href="#" data-tracy-action="window" title="open in window">&curren;</a>
<a href="#" data-tracy-action="close" title="close window">&times;</a>
</div>

0 comments on commit 10a0411

Please sign in to comment.
You can’t perform that action at this time.