Skip to content

Commit f1ec309

Browse files
jcohlmeyerJRC9 Devs
authored andcommitted
2.2.3 Auto Focus & Change Watcher Fix
1 parent f4e9913 commit f1ec309

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: VideoEmbed
2-
version: 2.2.2
2+
version: 2.2.3
33
description: A field type for embedding YouTube and Vimeo Videos
44
url: https://github.com/jrc9designstudio/statamic-video-embed
55
developer: JRC9 Design Studio

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Video Embed for Statamic 2
22
*Requirement:* Statamic v2.6.x, curl
3-
*Version:* 2.2.2
3+
*Version:* 2.2.3
44

55
### What is this?
66
Add YouTube and Vimeo videos to Statamic with a Video Embed field.
@@ -120,6 +120,7 @@ If you really want a simple tag that does it all for you, you can create your ow
120120
- `portrait_cinema` 9:21
121121

122122
### Version Log
123+
- 2.2.3 Auto Focus & Change Watcher Fix
123124
- 2.2.2 Add Replicator Preview Text
124125
- 2.2.1 Fix for Statamic 2.6
125126
- 2.2.0 Added support for duration from YouTube thanks to @JayVerb for your work on this & ajax abort (for slow requests)

resources/assets/js/fieldtype.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
/* global Vue, $, Fieldtype, translate */
2+
13
Vue.component('video_embed-fieldtype', {
2-
props: ['data', 'config', 'name'],
4+
mixins: [Fieldtype],
35

46
data: function() {
57
return {
68
loading: true,
79
fail: false,
810
previous_url: '',
911
youTubeKeySet: this.data.key.length > 0,
10-
ajax: undefined
12+
ajax: undefined,
13+
autoBindChangeWatcher: false // Disable the automagic binding
1114
}
1215
},
1316

@@ -106,13 +109,20 @@ Vue.component('video_embed-fieldtype', {
106109
},
107110

108111
methods: {
109-
getReplicatorPreviewText() {
112+
getReplicatorPreviewText: function() {
110113
return this.title;
111114
},
115+
focus: function() {
116+
this.$els.videoUrlField.focus();
117+
},
112118
getData: function () {
113119
// We are now loading ...
114120
this.loading = this.urlChanged ? true : false;
115121

122+
if (this.urlChanged) {
123+
this.bindChangeWatcher(); // Bind the change watcher
124+
}
125+
116126
$.ajaxSetup({
117127
cache: false,
118128
contentType: 'application/json; charset=utf-8',
@@ -250,6 +260,6 @@ Vue.component('video_embed-fieldtype', {
250260
'</div>' +
251261
'</div>' +
252262
'</div>' +
253-
'<input type="text" class="form-control" v-model="data.url" v-on:blur="getData" v-on:keyup="getData" v-on:input="getData" />' +
263+
'<input type="text" class="form-control" v-model="data.url" v-on:blur="getData" v-on:keyup="getData" v-on:input="getData" v-el:video-url-field />' +
254264
''
255265
});

0 commit comments

Comments
 (0)