Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
callidus
mc_frontend
Commits
c324607d
Commit
c324607d
authored
Oct 08, 2018
by
Konstantin Schulz
Browse files
text passage selection now has a default value if there is only 1 citation level
parent
b74bbd53
Changes
2
Show whitespace changes
Inline
Side-by-side
src/pages/corpus-detail/corpus-detail.ts
View file @
c324607d
...
...
@@ -41,6 +41,9 @@ export class CorpusDetailPage {
if
(
Object
.
keys
(
this
.
corpusProvider
.
currentCorpus
.
citations
).
length
===
0
)
{
this
.
addReferences
(
this
.
corpusProvider
.
currentCorpus
.
citation_level_1
);
}
else
{
this
.
initReffDisplay
();
}
this
.
translateService
.
get
(
"
INVALID_TEXT_RANGE
"
).
subscribe
((
value
)
=>
{
this
.
invalidTextRangeString
=
value
;
});
...
...
@@ -178,6 +181,9 @@ export class CorpusDetailPage {
this
.
corpusProvider
.
currentCorpus
.
citations
[
relevantCitationIndices
[
0
]].
subcitations
[
relevantCitationIndices
[
1
]].
subcitations
[
citation
.
value
]
=
citation
;
}
});
if
(
targetCitationLevel
===
this
.
corpusProvider
.
currentCorpus
.
citation_level_1
)
{
this
.
initReffDisplay
();
}
});
// , (error: HttpErrorResponse) => {
// // no further references available, go to text display
...
...
@@ -203,4 +209,15 @@ export class CorpusDetailPage {
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
50
));
this
.
areReffEditable
=
true
;
}
private
initReffDisplay
()
{
if
(
this
.
corpusProvider
.
currentCorpus
.
citation_level_2
===
CitationLevel
[
CitationLevel
.
default
]
&&
!
(
this
.
corpusProvider
.
currentTextRange
.
start
[
0
]
||
this
.
corpusProvider
.
currentTextRange
.
end
[
0
]))
{
let
availableCitationValues
:
number
[]
=
Object
.
keys
(
this
.
corpusProvider
.
currentCorpus
.
citations
).
map
(
Number
);
let
lowestValue
:
number
=
Math
.
min
.
apply
(
Math
,
availableCitationValues
);
if
(
this
.
corpusProvider
.
currentCorpus
.
citations
[
lowestValue
])
{
this
.
corpusProvider
.
currentTextRange
.
start
[
0
]
=
this
.
corpusProvider
.
currentCorpus
.
citations
[
lowestValue
].
value
;
this
.
corpusProvider
.
currentTextRange
.
end
[
0
]
=
this
.
corpusProvider
.
currentCorpus
.
citations
[
lowestValue
].
value
;
}
}
}
}
src/pages/preview/preview.ts
View file @
c324607d
...
...
@@ -22,7 +22,7 @@ import {HelperProvider} from "../../providers/helper/helper";
templateUrl
:
'
preview.html
'
,
})
export
class
PreviewPage
{
p
rivate
instructionsFillTheGapString
:
string
;
p
ublic
instructionsFillTheGapString
:
string
;
FileType
=
FileType
;
FeedBackPage
=
FeedbackPage
;
ExerciseTypeTranslation
=
ExerciseTypeTranslation
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment