Skip to content

Commit 231f432

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 27e12f2 + 9fdeec7 commit 231f432

File tree

4 files changed

+37
-29
lines changed

4 files changed

+37
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Can be found [here](https://quasarframework.github.io/app-extension-qpdfviewer)
3737

3838
# Example Code
3939
Be sure to check out the Test Project for more examples.
40-
```
40+
```html
4141
<q-pdfviewer
4242
v-model="show"
4343
src="'https://www.ets.org/Media/Tests/GRE/pdf/gre_research_validity_data.pdf'"

src/component/QPdfviewer.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ export default Vue.extend({
1111
type: {
1212
type: String,
1313
default: 'html5',
14-
validator: v => ['html5', 'pdfjs']
14+
validator: v => ['html5', 'pdfjs'].indexOf(v) !== -1
1515
},
1616
errorString: {
1717
type: String,
1818
default: 'This browser does not support PDFs. Download the PDF to view it:'
1919
},
20-
load: Function,
21-
error: Function,
2220
contentStyle: [String, Object, Array],
2321
contentClass: [String, Object, Array],
2422
innerContentStyle: [String, Object, Array],
@@ -44,8 +42,8 @@ export default Vue.extend({
4442
height: '100%'
4543
},
4644
on: {
47-
error: this.error ? this.error : '',
48-
load: this.load ? this.load : ''
45+
error: this.$listeners.error,
46+
load: this.$listeners.load
4947
}
5048
}, [
5149
// browser object not supported, try iframe

src/component/QPdfviewer.json

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@
2727
"default": "This browser does not support PDFs. Download the PDF to view it:",
2828
"examples": [ "error-string=\"Download the PDF to view it\"" ]
2929
},
30-
"load": {
31-
"type": "Function",
32-
"desc": "The function to be called when the pdf document has been loaded",
33-
"examples": [
34-
"@load=\"onLoad\""
35-
]
36-
},
37-
"error": {
38-
"type": "Function",
39-
"desc": "The function to be called when the pdf document has an error",
40-
"examples": [
41-
"@error=\"onError\""
42-
]
43-
},
4430
"content-class": {
4531
"type": [ "Array", "String", "Object" ],
4632
"desc": "Class definitions to be attributed to the PDF container",
@@ -73,5 +59,33 @@
7359
":inner-content-style=\"{ backgroundColor: '#ff0000' }\""
7460
]
7561
}
62+
},
63+
"events": {
64+
"load": {
65+
"desc": "The function to be called when the pdf document has been loaded",
66+
"params": {
67+
"evt": {
68+
"type": "Object",
69+
"desc": "JS event object",
70+
"required": true
71+
}
72+
},
73+
"examples": [
74+
"@load=\"onLoad\""
75+
]
76+
},
77+
"error": {
78+
"desc": "The function to be called when the pdf document has an error",
79+
"params": {
80+
"evt": {
81+
"type": "Object",
82+
"desc": "JS event object",
83+
"required": true
84+
}
85+
},
86+
"examples": [
87+
"@error=\"onError\""
88+
]
89+
}
7690
}
7791
}

src/component/pdfviewer.styl

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
width 100%
55

66
&__iframe
7-
border none
8-
9-
.q-pdfviewer iframe
10-
border 0
11-
height 100%
12-
left 0
13-
// position absolute
14-
top 0
15-
width 100%
7+
border 0
8+
height 100%
9+
left 0
10+
top 0
11+
width 100%

0 commit comments

Comments
 (0)