Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
576ea30a
Commit
576ea30a
authored
9 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-3287 : Tree navigation - switch events
SVN: 35853
parent
9f9be6e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js
+53
-18
53 additions, 18 deletions
...ms/html/js/views/DataSetForm/widgets/DatasetViewerView.js
with
53 additions
and
18 deletions
plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerView.js
+
53
−
18
View file @
576ea30a
...
@@ -20,16 +20,6 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -20,16 +20,6 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
this
.
$listIcon
=
null
;
this
.
$listIcon
=
null
;
this
.
$treeIcon
=
null
;
this
.
$treeIcon
=
null
;
this
.
updateDirectoryView
=
function
(
code
,
path
,
isBack
)
{
var
_this
=
this
;
mainController
.
serverFacade
.
listFilesForDataSet
(
code
,
path
,
false
,
function
(
files
)
{
if
(
!
isBack
)
{
_this
.
_dataSetViewerModel
.
lastUsedPath
.
push
(
path
);
}
_this
.
repaintFiles
(
code
,
files
.
result
);
});
}
this
.
repaintDatasets
=
function
()
{
this
.
repaintDatasets
=
function
()
{
var
_this
=
this
;
var
_this
=
this
;
...
@@ -75,7 +65,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -75,7 +65,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
var
getDatasetLinkEvent
=
function
(
code
)
{
var
getDatasetLinkEvent
=
function
(
code
)
{
return
function
(
event
)
{
return
function
(
event
)
{
_this
.
updateDirectoryView
(
code
,
"
/
"
);
var
repaintEvent
=
function
(
code
,
files
)
{
_this
.
repaintFiles
(
code
,
files
.
result
);
}
_this
.
updateDirectoryView
(
code
,
"
/
"
,
repaintEvent
);
};
};
}
}
...
@@ -169,9 +163,9 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -169,9 +163,9 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
var
$tree
=
$
(
"
<div>
"
,
{
"
id
"
:
"
tree
"
});
var
$tree
=
$
(
"
<div>
"
,
{
"
id
"
:
"
tree
"
});
$container
.
append
(
$tree
);
$container
.
append
(
$tree
);
var
treeModel
=
[{
title
:
datasetCode
,
key
:
datasetCode
,
menuData
:
datasetFiles
,
folder
:
true
,
children
:
[]
}];
var
treeModel
=
[{
title
:
datasetCode
,
key
:
"
/
"
,
menuData
:
datasetFiles
,
folder
:
true
,
lazy
:
true
}];
glyph_opts
=
{
var
glyph_opts
=
{
map
:
{
map
:
{
doc
:
"
glyphicon glyphicon-file
"
,
doc
:
"
glyphicon glyphicon-file
"
,
docOpen
:
"
glyphicon glyphicon-file
"
,
docOpen
:
"
glyphicon glyphicon-file
"
,
...
@@ -191,23 +185,52 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -191,23 +185,52 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
};
};
var
onActivate
=
function
(
event
,
data
)
{
var
onActivate
=
function
(
event
,
data
)
{
data
.
node
.
setExpanded
(
true
);
};
};
var
onClick
=
function
(
event
,
data
){
var
onClick
=
function
(
event
,
data
){
};
};
var
onLazyLoad
=
function
(
event
,
data
){
var
pathToLoad
=
data
.
node
.
key
;
};
$tree
.
fancytree
({
$tree
.
fancytree
({
extensions
:
[
"
dnd
"
,
"
edit
"
,
"
glyph
"
],
//, "wide"
extensions
:
[
"
dnd
"
,
"
edit
"
,
"
glyph
"
],
//, "wide"
glyph
:
glyph_opts
,
glyph
:
glyph_opts
,
source
:
treeModel
,
source
:
treeModel
,
activate
:
onActivate
,
activate
:
onActivate
,
click
:
onClick
click
:
onClick
,
lazyLoad
:
onLazyLoad
});
});
}
}
this
.
updateDirectoryView
=
function
(
code
,
path
,
isBack
,
repaintEvent
)
{
var
_this
=
this
;
mainController
.
serverFacade
.
listFilesForDataSet
(
code
,
path
,
false
,
function
(
files
)
{
if
(
!
isBack
)
{
_this
.
_dataSetViewerModel
.
lastUsedPath
.
push
(
path
);
}
if
(
!
repaintEvent
)
{
switch
(
_this
.
_dataSetViewerModel
.
dataSetViewerMode
)
{
case
DataSetViewerMode
.
LIST
:
_this
.
repaintFiles
(
code
,
files
.
result
);
break
;
case
DataSetViewerMode
.
TREE
:
//
break
;
}
}
else
{
repaintEvent
(
code
,
files
);
}
});
}
this
.
repaintFilesAsList
=
function
(
datasetCode
,
datasetFiles
,
$container
)
{
this
.
repaintFilesAsList
=
function
(
datasetCode
,
datasetFiles
,
$container
)
{
$container
.
empty
();
$container
.
empty
();
var
_this
=
this
;
var
_this
=
this
;
...
@@ -230,7 +253,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -230,7 +253,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
// Back
// Back
//
//
var
$directoryLink
=
$
(
"
<a>
"
).
text
(
"
..
"
).
click
(
function
(
event
)
{
var
$directoryLink
=
$
(
"
<a>
"
).
text
(
"
..
"
).
click
(
function
(
event
)
{
_this
.
updateDirectoryView
(
datasetCode
,
parent
);
var
repaintEvent
=
function
(
code
,
files
)
{
_this
.
repaintFiles
(
code
,
files
.
result
);
};
_this
.
updateDirectoryView
(
datasetCode
,
parent
,
repaintEvent
);
event
.
stopPropagation
();
event
.
stopPropagation
();
});
});
...
@@ -238,7 +265,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -238,7 +265,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
if
(
_this
.
_dataSetViewerModel
.
lastUsedPath
.
length
===
1
)
{
if
(
_this
.
_dataSetViewerModel
.
lastUsedPath
.
length
===
1
)
{
_this
.
repaintDatasets
();
_this
.
repaintDatasets
();
}
else
{
}
else
{
_this
.
updateDirectoryView
(
datasetCode
,
_this
.
_dataSetViewerModel
.
lastUsedPath
[
_this
.
_dataSetViewerModel
.
lastUsedPath
.
length
-
2
],
true
);
var
repaintEvent
=
function
(
code
,
files
)
{
_this
.
repaintFiles
(
code
,
files
.
result
);
};
_this
.
updateDirectoryView
(
datasetCode
,
_this
.
_dataSetViewerModel
.
lastUsedPath
[
_this
.
_dataSetViewerModel
.
lastUsedPath
.
length
-
2
],
true
,
repaintEvent
);
}
}
_this
.
_dataSetViewerModel
.
lastUsedPath
.
pop
();
_this
.
_dataSetViewerModel
.
lastUsedPath
.
pop
();
event
.
stopPropagation
();
event
.
stopPropagation
();
...
@@ -269,7 +300,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
...
@@ -269,7 +300,11 @@ function DataSetViewerView(dataSetViewerController, dataSetViewerModel) {
if
(
datasetFiles
[
i
].
isDirectory
)
{
if
(
datasetFiles
[
i
].
isDirectory
)
{
var
getDirectoyClickFuncion
=
function
(
datasetCode
,
pathInDataSet
)
{
var
getDirectoyClickFuncion
=
function
(
datasetCode
,
pathInDataSet
)
{
return
function
()
{
return
function
()
{
_this
.
updateDirectoryView
(
datasetCode
,
pathInDataSet
);
var
repaintEvent
=
function
(
code
,
files
)
{
_this
.
repaintFiles
(
code
,
files
.
result
);
};
_this
.
updateDirectoryView
(
datasetCode
,
pathInDataSet
,
repaintEvent
);
};
};
};
};
...
...
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