Skip to content

Commit 7198449

Browse files
committed
Minor code cleanup.
1 parent 83467f8 commit 7198449

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

src/Template/Requests/view.ctp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ use Cake\Core\Configure;
2424
</li>
2525
<?php endforeach; ?>
2626
<li id="panel-button">
27-
<?= $this->Html->image('DebugKit.cake.icon.png',
28-
['alt' => 'Debug Kit', 'title' => 'CakePHP ' . Configure::version() . ' Debug Kit']) ?>
27+
<?= $this->Html->image('DebugKit.cake.icon.png', [
28+
'alt' => 'Debug Kit', 'title' => 'CakePHP ' . Configure::version() . ' Debug Kit'
29+
]) ?>
2930
</li>
3031
</ul>
31-
<?php $this->Html->script('DebugKit.debug_kit', ['block' => true, 'id' => '__debug_kit', 'data-id' => $toolbar->id, 'data-url' => json_encode($this->Url->build('/')), 'data-full-url' => Router::url('/', true)]) ?>
32+
<?php $this->Html->script('DebugKit.debug_kit', [
33+
'block' => true,
34+
'id' => '__debug_kit',
35+
'data-id' => $toolbar->id,
36+
'data-url' => json_encode($this->Url->build('/')),
37+
'data-full-url' => Router::url('/', true)
38+
]) ?>

webroot/js/toolbar.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,21 @@ if (elem) {
3636
return;
3737
}
3838
var body = doc.body;
39+
40+
// Cannot use css text, because of CSP compatibility.
3941
iframe = doc.createElement('iframe');
40-
iframe.style.position = 'fixed';
41-
iframe.style.bottom = 0;
42-
iframe.style.right = 0;
43-
iframe.style.border = 0;
44-
iframe.style.outline = 0;
45-
iframe.style.overflow = 'hidden';
46-
iframe.style.zIndex = 99999;
42+
iframe.style.position = 'fixed';
43+
iframe.style.bottom = 0;
44+
iframe.style.right = 0;
45+
iframe.style.border = 0;
46+
iframe.style.outline = 0;
47+
iframe.style.overflow = 'hidden';
48+
iframe.style.zIndex = 99999;
4749
iframe.height = 40;
4850
iframe.width = 40;
4951
iframe.src = __debug_kit_base_url + 'debug_kit/toolbar/' + __debug_kit_id;
5052

5153
body.appendChild(iframe);
52-
5354
bodyOverflow = body.style.overflow;
5455

5556
window.addEventListener('message', onMessage, false);

0 commit comments

Comments
 (0)