Skip to content

Commit eaee4ed

Browse files
committed
add support for additional iframe attributes
1 parent d12581a commit eaee4ed

File tree

6 files changed

+49
-7
lines changed

6 files changed

+49
-7
lines changed

dist/vue-friendly-iframe.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-friendly-iframe v0.12.0 (https://github.com/officert/vue-friendly-iframe)
2+
* vue-friendly-iframe v0.13.0 (https://github.com/officert/vue-friendly-iframe)
33
* (c) 2019 Tim Officer
44
* Released under the MIT License.
55
*/
@@ -208,6 +208,22 @@ exports.default = {
208208
className: {
209209
type: String,
210210
required: false
211+
},
212+
frameborder: {
213+
type: String,
214+
required: false
215+
},
216+
gesture: {
217+
type: String,
218+
required: false
219+
},
220+
allow: {
221+
type: String,
222+
required: false
223+
},
224+
allowfullscreen: {
225+
type: String,
226+
required: false
211227
}
212228
},
213229
data: function data() {
@@ -247,6 +263,11 @@ exports.default = {
247263
this.iframeEl.setAttribute('target', '_parent');
248264
this.iframeEl.setAttribute('style', 'visibility: hidden; position: absolute; top: -99999px');
249265
if (this.className) this.iframeEl.setAttribute('class', this.className);
266+
if (this.class) this.iframeEl.setAttribute('class', this.class);
267+
if (this.frameborder) this.iframeEl.setAttribute('frameborder', this.frameborder);
268+
if (this.gesture) this.iframeEl.setAttribute('gesture', this.gesture);
269+
if (this.allow) this.iframeEl.setAttribute('allow', this.allow);
270+
if (this.allowfullscreen) this.iframeEl.setAttribute('allowfullscreen', this.allowfullscreen);
250271

251272
this.$el.appendChild(this.iframeEl);
252273

dist/vue-friendly-iframe.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-src/components/Home/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h2>Example</h2>
8686
<div class="iframe-loading" v-if="iframeLoading">
8787
iframe loading...
8888
</div>
89-
<vue-friendly-iframe :style="{ 'display' : iframeLoading ? 'none' : 'block' }" :src="example1Form.src + '/' + example1Form.searchTerm" @load="onLoad" @iframe-load="onIframeLoad" @document-load="onDocumentLoad"></vue-friendly-iframe>
89+
<vue-friendly-iframe :style="{ 'display' : iframeLoading ? 'none' : 'block' }" :src="example1Form.src + '/' + example1Form.searchTerm" @load="onLoad" @iframe-load="onIframeLoad" @document-load="onDocumentLoad" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen="allowfullscreen"></vue-friendly-iframe>
9090
</div>
9191
</div>
9292
</section>

docs/docs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-friendly-iframe",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"description": "Vue component for creating dynamic async iframes",
55
"main": "dist/vue-friendly-iframe.js",
66
"scripts": {

src/components/FriendlyIframe/index.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ export default {
2222
className: {
2323
type: String,
2424
required: false
25+
},
26+
frameborder: {
27+
type: String,
28+
required: false
29+
},
30+
gesture: {
31+
type: String,
32+
required: false
33+
},
34+
allow: {
35+
type: String,
36+
required: false
37+
},
38+
allowfullscreen: {
39+
type: String,
40+
required: false
2541
}
2642
},
2743
data() {
@@ -71,6 +87,11 @@ export default {
7187
this.iframeEl.setAttribute('target', '_parent');
7288
this.iframeEl.setAttribute('style', 'visibility: hidden; position: absolute; top: -99999px');
7389
if (this.className) this.iframeEl.setAttribute('class', this.className);
90+
if (this.class) this.iframeEl.setAttribute('class', this.class);
91+
if (this.frameborder) this.iframeEl.setAttribute('frameborder', this.frameborder);
92+
if (this.gesture) this.iframeEl.setAttribute('gesture', this.gesture);
93+
if (this.allow) this.iframeEl.setAttribute('allow', this.allow);
94+
if (this.allowfullscreen) this.iframeEl.setAttribute('allowfullscreen', this.allowfullscreen);
7495
7596
this.$el.appendChild(this.iframeEl);
7697

0 commit comments

Comments
 (0)