Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
wouterj wants to merge16 commits intosymfony:2.4fromwouterj:form_debugger_js
Closed
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
0e03189
Expand tree
wouterjDec 24, 2013
60b0764
Improved form tree
wouterjDec 26, 2013
111a404
Made sections collapsable
wouterjDec 26, 2013
f21dab2
Added error badge
wouterjDec 29, 2013
52b1620
Fixed CS
wouterjDec 29, 2013
11bfda6
[WebProfilerBundle] Vertically centered the icons in the form tree
webmozartDec 29, 2013
07994d5
[WebProfilerBundle] Improved JavaScript of the form debugger
webmozartDec 30, 2013
ebf13ed
[WebProfilerBundle] Inverted toggler images and improved button coloring
webmozartDec 30, 2013
505c5be
[WebProfilerBundle] Added "use strict" statements
webmozartDec 30, 2013
a0030b8
[WebProfilerBundle] Changed toggle color back to blue and made headli…
webmozartDec 30, 2013
58559d3
[WebProfilerBundle] Moved toggle icon behind the headlines in the for…
webmozartDec 30, 2013
5afbaeb
[WebProfilerBundle] Enlarged the clickable area of the toggle button …
webmozartDec 30, 2013
c763d65
Merge pull request #1 from bschussek/issue9857
wouterjDec 30, 2013
53f164f
Fixed asset function
wouterjDec 30, 2013
226ac7c
Reverted new image
wouterjDec 30, 2013
406756d
Reverted Sfjs.toggle change
wouterjDec 30, 2013
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
NextNext commit
Expand tree
  • Loading branch information
@wouterj
wouterj committedDec 29, 2013
commit0e03189a4f8be315a216db3aeb95c62833f02757
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,29 +45,42 @@
padding: 0;
width: 100%;
}
.tree a {
text-decoration: none;
display: block;
.tree .tree-inner {
width:100%;
Copy link
Member

Choose a reason for hiding this comment

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

you should add a space aftr the: everywhere to have consistent coding standards in the CSS

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

yes, will do. Sorry, I'm used to type as less spaces as possible in CSS...

Copy link
Member

Choose a reason for hiding this comment

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

Can you fix spaces issues here and below?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

done

padding: 5px 7px;
border-radius: 6px;
color: #313131;
cursor:pointer;

-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.tree a {
text-decoration: none;
}
.tree button {
width:10px;
height:10px;
background: none;
border: none;
}
.tree ul ula {
.tree ul ul.tree-inner {
padding-left: 22px;
}
.tree ul ul ula {
.tree ul ul ul.tree-inner {
padding-left: 37px;
}
.tree ul ul ul ula {
.tree ul ul ul ul.tree-inner {
padding-left: 52px;
}
.tree ul ul ul ul ula {
.tree ul ul ul ul ul.tree-inner {
padding-left: 67px;
}
.treea:hover {
.tree.tree-inner:hover {
background: #dfdfdf;
}
.treea.active,a.active:hover {
.tree.tree-inner.active,.tree .tree-inner.active:hover {
background: #dfdfdf;
font-weight: bold;
color: #313131;
Expand DownExpand Up@@ -107,12 +120,63 @@
{% endif %}

<script>
function TreeView(tree) {
this.collapseAll = function () {
var children = tree.querySelectorAll('ul');

for (var i = 0, l = children.length; i < l; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is thisl ever used elsewhere?

Copy link
Member

Choose a reason for hiding this comment

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

yes, ini < l for the loop condition

if (children[i].style.display != 'none') {
children[i].style.display = 'none';
} else {
children[i].style.display = 'block';
}
}
};

this.expand = function (element) {
element.style.display = 'block';
};

this.collapse = function (element) {
element.style.display = 'none';
};

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

return 'collapse';
}

this.expand(element);

return 'expand';
}
}

var tree = document.querySelector('.tree ul');

var treeView = new TreeView(tree);
treeView.collapseAll();
treeView.expand(document.querySelector('.tree ul ul'));

var buttons = tree.querySelectorAll('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'))) {
this.textContent = '+';
} else {
this.textContent = '-';
}
}, false);
}

function TabView() {
var _activeLink = null,
_activeView = null;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@bschussek this change removes including the hash in the URL, it'll be very easy to integrate that again, but I didn't see any advantage over that? (as the script did nothing with the hash)

Copy link
Contributor

Choose a reason for hiding this comment

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

No problem. I think the original idea was to link to the details of individual fields, but that didn't work anyway. We can add this later when we actually need it.


this.init = function () {
var links = document.querySelectorAll('.treea'),
var links = document.querySelectorAll('.tree.tree-inner'),
views = document.querySelectorAll('.tree-details'),
i,
l;
Copy link
Contributor

Choose a reason for hiding this comment

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

i see a usage here oh

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

this is another l variable, the one from the TabView scope, not the TreeView scope

Expand All@@ -122,8 +186,7 @@
var link = links[i];

link.addEventListener('click', function (e) {
var href = link.getAttribute('href'),
targetId = href.substr(href.indexOf('#') + 1),
var targetId = 'details_' + link.dataset.targetId,
view = document.getElementById(targetId);

if (view) {
Expand DownExpand Up@@ -173,7 +236,12 @@

{% macro form_tree_entry(name, data) %}
<li>
<a href="#details_{{ data.id }}">{{ name }}</a>
<div class="tree-inner" data-target-id="{{ data.id }}">
{% if data.children is not empty %}
<button>+</button>
{% endif %}
{{ name }}
</div>

{% if data.children is not empty %}
<ul>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp