Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5c951230
Commit
5c951230
authored
Jul 29, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
cbc43028
f039d592
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
app/assets/javascripts/pdf/index.vue
app/assets/javascripts/pdf/index.vue
+8
-8
app/assets/javascripts/pdf/page/index.vue
app/assets/javascripts/pdf/page/index.vue
+3
-1
changelogs/unreleased/sh-fix-pdfjs-page-ordering.yml
changelogs/unreleased/sh-fix-pdfjs-page-ordering.yml
+5
-0
No files found.
app/assets/javascripts/pdf/index.vue
View file @
5c951230
...
...
@@ -14,7 +14,6 @@ export default {
},
data
()
{
return
{
loading
:
false
,
pages
:
[],
};
},
...
...
@@ -37,17 +36,18 @@ export default {
return
pdfjsLib
.
getDocument
(
this
.
document
)
.
then
(
this
.
renderPages
)
.
then
(()
=>
this
.
$emit
(
'
pdflabload
'
))
.
catch
(
error
=>
this
.
$emit
(
'
pdflaberror
'
,
error
))
.
then
(()
=>
{
this
.
loading
=
false
;
.
then
(
pages
=>
{
this
.
pages
=
pages
;
this
.
$emit
(
'
pdflabload
'
);
})
.
catch
(
error
=>
{
this
.
$emit
(
'
pdflaberror
'
,
error
);
});
},
renderPages
(
pdf
)
{
const
pagePromises
=
[];
this
.
loading
=
true
;
for
(
let
num
=
1
;
num
<=
pdf
.
numPages
;
num
+=
1
)
{
pagePromises
.
push
(
pdf
.
getPage
(
num
)
.
then
(
p
=>
this
.
pages
.
push
(
p
))
);
pagePromises
.
push
(
pdf
.
getPage
(
num
));
}
return
Promise
.
all
(
pagePromises
);
},
...
...
@@ -59,8 +59,8 @@ export default {
<div
v-if=
"hasPDF"
class=
"pdf-viewer"
>
<page
v-for=
"(page, index) in pages"
v-if=
"page"
:key=
"index"
:v-if=
"!loading"
:page=
"page"
:number=
"index + 1"
/>
...
...
app/assets/javascripts/pdf/page/index.vue
View file @
5c951230
...
...
@@ -39,7 +39,9 @@ export default {
.
then
(()
=>
{
this
.
rendering
=
false
;
})
.
catch
(
error
=>
this
.
$emit
(
'
pdflaberror
'
,
error
));
.
catch
(
error
=>
{
this
.
$emit
(
'
pdflaberror
'
,
error
);
});
},
};
</
script
>
...
...
changelogs/unreleased/sh-fix-pdfjs-page-ordering.yml
0 → 100644
View file @
5c951230
---
title
:
Fix pdf.js rendering pages in the wrong order
merge_request
:
31222
author
:
type
:
fixed
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