Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
maarchRM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
maarchRM
Commits
b8315c67
Commit
b8315c67
authored
8 years ago
by
Prosper De Laure
Browse files
Options
Downloads
Patches
Plain Diff
Tree ergonomy and tree script improvement
parent
16dc7dcb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dependency/html/public/js/bootstrap-tree/bootstrap-tree.js
+17
-10
17 additions, 10 deletions
dependency/html/public/js/bootstrap-tree/bootstrap-tree.js
src/presentation/maarchRM/Resources/view/filePlan/tree.html
+11
-3
11 additions, 3 deletions
src/presentation/maarchRM/Resources/view/filePlan/tree.html
with
28 additions
and
13 deletions
dependency/html/public/js/bootstrap-tree/bootstrap-tree.js
+
17
−
10
View file @
b8315c67
...
...
@@ -40,7 +40,7 @@ var BootstrapTree = {
ul
.
appendTo
(
tree
);
},
addNode
:
function
(
parent
,
element
)
{
addNode
:
function
(
parent
,
element
,
openNode
)
{
if
(
!
element
||
!
parent
)
{
return
;
}
...
...
@@ -55,7 +55,7 @@ var BootstrapTree = {
.
removeClass
(
parentIcon
.
data
(
'
default-icon
'
))
.
on
(
'
click
'
,
BootstrapTree
.
toggleNode
);
}
elementIcon
=
element
.
find
(
'
.fa:first
'
);
elementIcon
.
addClass
(
elementIcon
.
data
(
'
default-icon
'
));
...
...
@@ -65,7 +65,10 @@ var BootstrapTree = {
}
element
.
appendTo
(
ul
);
this
.
openNode
(
parent
);
if
(
openNode
||
openNode
==
undefined
)
{
this
.
openNode
(
parent
);
}
},
removeNode
:
function
(
element
)
{
...
...
@@ -93,12 +96,9 @@ var BootstrapTree = {
var
openedIcon
=
i
.
data
(
'
opened-icon
'
);
var
closedIcon
=
i
.
data
(
'
closed-icon
'
);
if
(
!
i
.
hasClass
(
openedIcon
))
{
if
(
!
i
.
hasClass
(
openedIcon
)
&&
children
.
length
)
{
children
.
show
(
'
fast
'
);
console
.
log
(
i
);
i
.
addClass
(
openedIcon
).
removeClass
(
closedIcon
);
}
else
{
alert
(
"
Error
"
);
}
},
...
...
@@ -130,6 +130,7 @@ var BootstrapTree = {
return
;
}
var
elementUl
=
element
.
closest
(
'
ul
'
);
var
ul
=
target
.
find
(
'
> ul
'
);
if
(
ul
.
length
==
0
)
{
ul
=
$
(
'
<ul/>
'
).
appendTo
(
target
);
...
...
@@ -138,15 +139,21 @@ var BootstrapTree = {
target
.
addClass
(
'
parent_li
'
);
targetIcon
.
addClass
(
targetIcon
.
data
(
'
opened-icon
'
))
.
removeClass
(
targetIcon
.
data
(
'
default-icon
'
))
.
on
(
'
click
'
,
BootstrapTree
.
toggleNode
);
}
ul
.
append
(
element
);
var
targetUl
=
target
.
find
(
'
ul
'
);
if
(
targetUl
.
length
==
0
)
{
targetUl
.
remove
();
if
(
elementUl
.
find
(
'
li
'
).
length
==
0
)
{
var
icon
=
elementUl
.
closest
(
'
li
'
).
find
(
'
.fa:first
'
);
console
.
log
(
elementUl
);
elementUl
.
remove
();
icon
.
removeClass
(
icon
.
data
(
'
opened-icon
'
)
+
'
'
+
icon
.
data
(
'
closed-icon
'
))
.
addClass
(
icon
.
data
(
'
default-icon
'
));
}
this
.
openNode
(
target
);
}
...
...
This diff is collapsed.
Click to expand it.
src/presentation/maarchRM/Resources/view/filePlan/tree.html
+
11
−
3
View file @
b8315c67
...
...
@@ -48,6 +48,9 @@
#filePlanMenu
{
visibility
:
hidden
;
}
.ui-draggable-drsagging
{
position
:
absolute
!important
;
}
</style>
<script>
...
...
@@ -162,7 +165,7 @@
},
initDragNDrop
:
function
()
{
$
(
'
#filePlanTree
'
).
find
(
'
.folderNode
'
).
draggable
(
DroppableOption
)
$
(
'
#filePlanTree
'
).
find
(
'
.folderNode
'
).
parent
().
draggable
(
DroppableOption
)
$
(
'
#filePlanTree
'
).
find
(
'
.folderNode
'
).
droppable
(
FolderDroppableOption
);
$
(
'
#filePlanTree
'
).
find
(
'
.orgNode
'
).
droppable
(
OrganizationDroppableOption
);
}
...
...
@@ -229,12 +232,17 @@
DroppableOption
=
{
revert
:
true
,
zIndex
:
100
zIndex
:
100
,
helper
:
"
clone
"
}
FolderDroppableOption
=
{
over
:
function
(
event
,
ui
)
{
FolderNode
.
moveIn
(
$
(
this
));
parent
=
$
(
this
);
FolderNode
.
moveIn
(
parent
);
setTimeout
(
function
()
{
BootstrapTree
.
openNode
(
parent
.
closest
(
'
li
'
));
},
800
);
},
out
:
function
(
event
,
ui
)
{
FolderNode
.
moveOut
(
$
(
this
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment