Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
c00b75d7
Commit
c00b75d7
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
use replace history function
parent
bc3abbc1
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
src/components/DictionaryView.vue
+19
-65
19 additions, 65 deletions
src/components/DictionaryView.vue
with
19 additions
and
65 deletions
src/components/DictionaryView.vue
+
19
−
65
View file @
c00b75d7
...
@@ -113,15 +113,7 @@ function navigate_to_article(self, source) {
...
@@ -113,15 +113,7 @@ function navigate_to_article(self, source) {
})
})
.
then
(
function
(
response
){
.
then
(
function
(
response
){
self
.
waiting_for_articles
=
false
self
.
waiting_for_articles
=
false
history
.
replaceState
({
article
:
self
.
article
,
this
.
replace_history
()
search_results
:
{},
lang
:
self
.
lang
,
error
:
self
.
error
,
pos_selected
:
self
.
pos_selected
,
scope
:
self
.
scope
,
article_info
:
self
.
article_info
,
page
:
self
.
page
,
perPage
:
self
.
perPage
},
''
)
if
(
source
)
{
if
(
source
)
{
self
.
$plausible
.
trackEvent
(
'
internal link incoming
'
,
{
props
:
{
origin
:
source
}})
self
.
$plausible
.
trackEvent
(
'
internal link incoming
'
,
{
props
:
{
origin
:
source
}})
}
}
...
@@ -230,17 +222,7 @@ function navigate_to_query(self, word) {
...
@@ -230,17 +222,7 @@ function navigate_to_query(self, word) {
}
}
self
.
waiting_for_articles
=
false
self
.
waiting_for_articles
=
false
history
.
replaceState
({
self
.
replace_history
()
article
:
self
.
article
,
lang
:
self
.
lang
,
error
:
self
.
error
,
pos_selected
:
self
.
pos_selected
,
scope
:
self
.
scope
,
article_info
:
self
.
article_info
,
search_results
:
self
.
search_results
,
page
:
self
.
page
,
perPage
:
self
.
perPage
},
''
)
self
.
previous
=
self
.
$route
.
fullPath
self
.
previous
=
self
.
$route
.
fullPath
})
})
...
@@ -290,6 +272,19 @@ export default {
...
@@ -290,6 +272,19 @@ export default {
SearchToolbar
SearchToolbar
},
},
methods
:
{
methods
:
{
replace_history
:
function
()
{
history
.
replaceState
({
article
:
this
.
article
,
search_results
:
{},
lang
:
this
.
lang
,
error
:
null
,
scope
:
this
.
scope
,
article_info
:
this
.
article_info
,
page
:
this
.
page
,
perPage
:
this
.
perPage
,
selected
:
this
.
selected
,
inflection_suggestions
:
this
.
inflection_suggestions
},
''
)
},
total_results
:
function
()
{
total_results
:
function
()
{
if
(
this
.
article_info
)
{
if
(
this
.
article_info
)
{
let
total
=
0
let
total
=
0
...
@@ -384,17 +379,7 @@ export default {
...
@@ -384,17 +379,7 @@ export default {
Promise
.
all
([
Promise
.
all
([
load_articles
(
this
,
query
,
offset
,
this
.
perPage
,
"
bm
"
),
load_articles
(
this
,
query
,
offset
,
this
.
perPage
,
"
bm
"
),
load_articles
(
this
,
query
,
offset
,
this
.
perPage
,
"
nn
"
)]).
then
(()
=>
{
load_articles
(
this
,
query
,
offset
,
this
.
perPage
,
"
nn
"
)]).
then
(()
=>
{
history
.
replaceState
({
article
:
self
.
article
,
self
.
replace_history
()
search_results
:
self
.
search_results
,
lang
:
self
.
lang
,
error
:
self
.
error
,
pos_selected
:
self
.
pos_selected
,
scope
:
self
.
scope
,
article_info
:
self
.
article_info
,
page
:
self
.
page
,
perPage
:
self
.
perPage
,
selected
:
self
.
selected
,
inflection_suggestions
:
self
.
inflection_suggestions
},
''
),
self
.
$forceUpdate
()
self
.
$forceUpdate
()
}
}
...
@@ -441,17 +426,7 @@ export default {
...
@@ -441,17 +426,7 @@ export default {
article_link_click
:
function
(
item
)
{
article_link_click
:
function
(
item
)
{
if
(
this
.
article
&&
this
.
article
.
article_id
==
item
.
article_id
){
if
(
this
.
article
&&
this
.
article
.
article_id
==
item
.
article_id
){
this
.
article_key
++
this
.
article_key
++
history
.
replaceState
({
article
:
this
.
article
,
this
.
replace_history
()
search_results
:
this
.
search_results
,
lang
:
this
.
lang
,
error
:
this
.
error
,
pos_selected
:
this
.
pos_selected
,
scope
:
this
.
scope
,
article_info
:
this
.
article_info
,
page
:
this
.
page
,
perPage
:
this
.
perPage
,
selected
:
this
.
selected
,
inflection_suggestions
:
this
.
inflection_suggestions
},
''
)
}
else
{
}
else
{
navigate_to_article
(
this
,
item
.
source
)
navigate_to_article
(
this
,
item
.
source
)
...
@@ -461,17 +436,7 @@ export default {
...
@@ -461,17 +436,7 @@ export default {
item
.
article
.
source
=
this
.
$route
.
fullPath
item
.
article
.
source
=
this
.
$route
.
fullPath
this
.
previous
=
this
.
previous
.
split
(
'
#
'
)[
0
]
+
"
#
"
+
item
.
title_id
this
.
previous
=
this
.
previous
.
split
(
'
#
'
)[
0
]
+
"
#
"
+
item
.
title_id
this
.
article
=
item
.
article
this
.
article
=
item
.
article
history
.
replaceState
({
article
:
this
.
article
,
this
.
replace_history
()
search_results
:
{},
lang
:
this
.
lang
,
error
:
null
,
pos_selected
:
this
.
pos_selected
,
scope
:
this
.
scope
,
article_info
:
this
.
article_info
,
page
:
this
.
page
,
perPage
:
this
.
perPage
,
selected
:
this
.
selected
,
inflection_suggestions
:
this
.
inflection_suggestions
},
''
)
},
},
return_to_results
:
function
()
{
return_to_results
:
function
()
{
this
.
article
=
null
this
.
article
=
null
...
@@ -515,18 +480,7 @@ export default {
...
@@ -515,18 +480,7 @@ export default {
}
}
else
{
else
{
self
.
waiting_for_articles
=
false
self
.
waiting_for_articles
=
false
history
.
replaceState
({
article
:
self
.
article
,
self
.
replace_history
()
search_results
:
self
.
search_results
,
lang
:
self
.
lang
,
error
:
self
.
error
,
pos_selected
:
self
.
pos_selected
,
scope
:
self
.
scope
,
article_info
:
self
.
article_info
,
page
:
self
.
page
,
perPage
:
self
.
perPage
,
selected
:
self
.
selected
,
inflection_suggestions
:
self
.
inflection_suggestions
},
''
)
self
.
load_monthly_bm
()
self
.
load_monthly_bm
()
self
.
load_monthly_nn
()
self
.
load_monthly_nn
()
...
...
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