bug #14483 [VarDumper] Fix #14481 : Open tree recursively on OSX (romainneutron)

This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix #14481 : Open tree recursively on OSX

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14481
| License       | MIT

Commits
-------

af54bda [VarDumper] Fix #14481 : Open tree recursively on OSX
This commit is contained in:
Nicolas Grekas 2015-04-27 18:40:03 +02:00
commit 17ee6a633a

View File

@ -176,6 +176,9 @@ return function (root) {
}
});
};
function isCtrlKey(e) {
return e.ctrlKey || e.metaKey;
}
addEventListener(root, 'mouseover', function (e) {
if ('' != refStyle.innerHTML) {
refStyle.innerHTML = '';
@ -192,7 +195,7 @@ return function (root) {
a('click', function (a, e) {
if (/\bsf-dump-toggle\b/.test(a.className)) {
e.preventDefault();
if (!toggle(a, e.ctrlKey)) {
if (!toggle(a, isCtrlKey(e))) {
var r = doc.getElementById(a.getAttribute('href').substr(1)),
s = r.previousSibling,
f = r.parentNode,
@ -206,7 +209,7 @@ return function (root) {
r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
}
if ('sf-dump-compact' == r.className) {
toggle(s, e.ctrlKey);
toggle(s, isCtrlKey(e));
}
}