Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue 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
caosdb
Software
caosdb-webui
Commits
30749239
Verified
Commit
30749239
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: refactor ext_bottom_line
parent
ed11b091
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/js/ext_applicable.js
+16
-0
16 additions, 0 deletions
src/core/js/ext_applicable.js
src/core/js/ext_bottom_line.js
+5
-12
5 additions, 12 deletions
src/core/js/ext_bottom_line.js
with
21 additions
and
12 deletions
src/core/js/ext_applicable.js
+
16
−
0
View file @
30749239
...
...
@@ -93,6 +93,18 @@ var ext_applicable = function($, logger, is_in_view_port, load_config, getEntity
}
}
var
make_creators
=
function
(
creators
)
{
const
result
=
[];
for
(
let
c
of
creators
)
{
result
.
push
({
id
:
c
.
id
,
is_applicable
:
typeof
c
.
is_applicable
===
"
function
"
?
c
.
is_applicable
:
eval
(
c
.
is_applicable
),
create
:
typeof
c
.
create
===
"
function
"
?
c
.
create
:
eval
(
c
.
create
)
});
}
return
result
;
}
var
root_handler_trigger
=
function
(
root_handler
)
{
var
entities
=
$
(
"
.caosdb-entity-panel,.caosdb-entity-preview
"
);
...
...
@@ -136,6 +148,9 @@ var ext_applicable = function($, logger, is_in_view_port, load_config, getEntity
return
true
;
},
true
);
// trigger for the first time
trigger
();
};
return
{
...
...
@@ -143,6 +158,7 @@ var ext_applicable = function($, logger, is_in_view_port, load_config, getEntity
root_creator
:
root_creator
,
root_handler
:
root_handler
,
previewReadyEvent
:
previewReadyEvent
,
make_creators
:
make_creators
,
_css_class_preview_container
:
_css_class_preview_container
,
_css_class_preview_container_button
:
_css_class_preview_container_button
,
_css_class_preview_container_resolvable
:
_css_class_preview_container_resolvable
,
...
...
This diff is collapsed.
Click to expand it.
src/core/js/ext_bottom_line.js
+
5
−
12
View file @
30749239
...
...
@@ -258,28 +258,23 @@ var ext_bottom_line = function($, logger, is_in_view_port, load_config, getEntit
*
* @param {BottomLineConfig} config
*/
var
configure
=
async
function
(
config
,
default_config
)
{
var
configure
=
async
function
(
config
)
{
logger
.
debug
(
"
configure
"
,
config
);
if
(
config
.
version
!=
"
0.1
"
)
{
throw
new
Error
(
"
Wrong version in config.
"
);
}
fallback_preview
=
config
.
fallback
||
fallback_preview
;
// append/load creators
// append/load custom creators
_creators
.
splice
(
0
,
_creators
.
length
);
for
(
let
c
of
config
.
creators
)
{
_creators
.
push
({
id
:
c
.
id
,
is_applicable
:
typeof
c
.
is_applicable
===
"
function
"
?
c
.
is_applicable
:
eval
(
c
.
is_applicable
),
create
:
typeof
c
.
create
===
"
function
"
?
c
.
create
:
eval
(
c
.
create
)
});
for
(
let
c
of
ext_applicable
.
make_creators
(
config
.
creators
))
{
_creators
.
push
(
c
);
}
// append default creators
for
(
let
c
of
_default_creators
)
{
_creators
.
push
(
c
);
}
fallback_preview
=
config
.
fallback
||
fallback_preview
;
};
...
...
@@ -302,8 +297,6 @@ var ext_bottom_line = function($, logger, is_in_view_port, load_config, getEntit
ext_applicable
.
init_watcher
(
_config
.
delay
||
500
,
root_preview_handler_trigger
);
// trigger the whole thing for the first time
root_preview_handler_trigger
();
}
catch
(
err
)
{
logger
.
error
(
err
);
...
...
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