Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
42ab97d6
Commit
42ab97d6
authored
Feb 09, 2021
by
Seb
Browse files
Fix thumbnail updating
parent
8a67f903
Changes
1
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/static/wagtailvideos/js/video-chooser.js
View file @
42ab97d6
function
createVideoChooser
(
id
)
{
function
createVideoChooser
(
id
)
{
var
chooserElement
=
$
(
'
#
'
+
id
+
'
-chooser
'
);
var
chooserElement
=
$
(
'
#
'
+
id
+
'
-chooser
'
);
var
previewVideo
=
chooserElement
.
find
(
'
.
video-thumb
img
'
);
var
previewVideo
=
chooserElement
.
find
(
'
.
preview-image
img
'
);
var
input
=
$
(
'
#
'
+
id
);
var
input
=
$
(
'
#
'
+
id
);
var
editLink
=
chooserElement
.
find
(
'
.edit-link
'
);
var
editLink
=
chooserElement
.
find
(
'
.edit-link
'
);
$
(
'
.action-choose
'
,
chooserElement
).
click
(
function
()
{
$
(
'
.action-choose
'
,
chooserElement
).
click
(
function
()
{
ModalWorkflow
({
ModalWorkflow
({
url
:
window
.
chooserUrls
.
videoChooser
,
url
:
window
.
chooserUrls
.
videoChooser
,
onload
:
VIDEO_CHOOSER_MODAL_ONLOAD_HANDLERS
,
onload
:
VIDEO_CHOOSER_MODAL_ONLOAD_HANDLERS
,
responses
:
{
responses
:
{
videoChosen
:
function
(
videoData
)
{
videoChosen
:
function
(
videoData
)
{
input
.
val
(
videoData
.
id
);
input
.
val
(
videoData
.
id
);
previewVideo
.
attr
({
previewVideo
.
attr
({
src
:
videoData
.
preview
.
url
,
src
:
videoData
.
preview
.
url
,
...
@@ -22,7 +22,7 @@ function createVideoChooser(id) {
...
@@ -22,7 +22,7 @@ function createVideoChooser(id) {
});
});
});
});
$
(
'
.action-clear
'
,
chooserElement
).
click
(
function
()
{
$
(
'
.action-clear
'
,
chooserElement
).
click
(
function
()
{
input
.
val
(
''
);
input
.
val
(
''
);
chooserElement
.
addClass
(
'
blank
'
);
chooserElement
.
addClass
(
'
blank
'
);
});
});
...
...
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