Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
callidus
mc_frontend
Commits
4f3fe0d9
Commit
4f3fe0d9
authored
Aug 29, 2018
by
Konstantin Schulz
Browse files
small fix to avoid unnecessary calls to the CTS API
parent
b4c06296
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pages/corpus-detail/corpus-detail.ts
View file @
4f3fe0d9
...
...
@@ -24,6 +24,7 @@ export class CorpusDetailPage {
private
noTextRangeChosenString
:
string
;
public
CitationLevel
=
CitationLevel
;
private
invalidTextRangeString
:
string
;
public
isTransitioningToTextPage
:
boolean
=
false
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
corpusProvider
:
CorpusProvider
,
...
...
@@ -50,28 +51,30 @@ export class CorpusDetailPage {
}
showFurtherReferences
(
urn
:
string
,
currentCitationLevel
:
number
,
isStart
:
boolean
)
{
if
(
currentCitationLevel
===
1
&&
this
.
corpusProvider
.
currentCorpus
.
citation_level_2
!==
CitationLevel
[
CitationLevel
.
default
])
{
// change display for further references
if
(
isStart
)
{
this
.
corpusProvider
.
currentTextRange
.
start
[
currentCitationLevel
]
=
""
;
}
else
{
this
.
corpusProvider
.
currentTextRange
.
end
[
currentCitationLevel
]
=
""
;
}
this
.
checkFurtherReferences
(
urn
,
isStart
,
false
);
if
(
!
this
.
isTransitioningToTextPage
)
{
if
(
currentCitationLevel
===
1
&&
this
.
corpusProvider
.
currentCorpus
.
citation_level_2
!==
CitationLevel
[
CitationLevel
.
default
])
{
// change display for further references
if
(
isStart
)
{
this
.
corpusProvider
.
currentTextRange
.
start
[
currentCitationLevel
]
=
""
;
}
else
{
this
.
corpusProvider
.
currentTextRange
.
end
[
currentCitationLevel
]
=
""
;
}
this
.
checkFurtherReferences
(
urn
,
isStart
,
false
);
}
else
if
(
currentCitationLevel
===
2
&&
this
.
corpusProvider
.
currentCorpus
.
citation_level_3
!==
CitationLevel
[
CitationLevel
.
default
])
{
// change display for further references
if
(
isStart
)
{
this
.
corpusProvider
.
currentTextRange
.
start
[
currentCitationLevel
]
=
""
;
}
else
{
this
.
corpusProvider
.
currentTextRange
.
end
[
currentCitationLevel
]
=
""
;
else
if
(
currentCitationLevel
===
2
&&
this
.
corpusProvider
.
currentCorpus
.
citation_level_3
!==
CitationLevel
[
CitationLevel
.
default
])
{
// change display for further references
if
(
isStart
)
{
this
.
corpusProvider
.
currentTextRange
.
start
[
currentCitationLevel
]
=
""
;
}
else
{
this
.
corpusProvider
.
currentTextRange
.
end
[
currentCitationLevel
]
=
""
;
}
this
.
checkFurtherReferences
(
urn
,
isStart
,
true
);
}
this
.
checkFurtherReferences
(
urn
,
isStart
,
true
);
}
}
...
...
@@ -108,6 +111,7 @@ export class CorpusDetailPage {
toast
.
present
().
then
();
}
else
{
this
.
isTransitioningToTextPage
=
true
;
this
.
adjustCurrentTextRange
();
let
startNumber
:
number
=
+
this
.
corpusProvider
.
currentTextRange
.
start
.
join
(
""
);
let
endNumber
:
number
=
+
this
.
corpusProvider
.
currentTextRange
.
end
.
join
(
""
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment