8000 Form Debugger JavaScript improvements by wouterj · Pull Request #9857 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Form Debugger JavaScript improvements #9857

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

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved form tree
  • Loading branch information
wouterj committed Dec 29, 2013
commit 60b076495bbd966c8c5ee7c27e296559db6d2578
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
.tree a {
text-decoration: none;
}
.tree button {
.tree .toggle-button {
width:10px;
height:10px;
background: none;
Expand Down Expand Up @@ -142,15 +142,20 @@
};

this.toggle = function (element) {
var r;

if (element.style.display !== 'none') {
this.collapse(element);
// this.collapse(element);

return 'collapse';
r = 'collapse';
} else {
// this.expand(element);
}

this.expand(element);
var imgs = element.parentElement.getElementsByTagName('img');
Sfjs.toggle(element, imgs[0], imgs[1]);

return 'expand';
return r || 'expand';
}
}

Expand All @@ -160,7 +165,7 @@
treeView.collapseAll();
treeView.expand(document.querySelector('.tree ul ul'));

var buttons = tree.querySelectorAll('button');
var buttons = tree.querySelectorAll('.toggle-button');
for (var j = 0, l = buttons.length; j < l; j++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here

buttons[j].addEventListener('click', function (e) {
if ('collapse' === treeView.toggle(this.parentElement.parentElement.querySelector('ul'))) {
Expand Down Expand Up @@ -238,7 +243,10 @@
<li>
<div class="tree-inner" data-target-id="{{ data.id }}">
{% if data.children is not empty %}
<button>+</button>
<img class="toggle-button" style="display:inline;" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}">
<img class="toggle-button" style="display:none;" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}">
{% else %}
<img class="toggle-button" src="{{ asset('bundles/framework/images/blue_picto_full.gif') }}">
{% endif %}
{{ name }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
var i,
style,
tmp = elOn.style.display,
el = document.getElementById(selector);
el = selector.nodeName ? selector : document.getElementById(selector);

elOn.style.display = elOff.style.display;
elOff.style.display = tmp;
Expand Down
0