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
67050185
Commit
67050185
authored
Oct 03, 2022
by
13hakta
Browse files
Handle loading previews in chooser ui
parent
c4294f71
Changes
1
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/static/wagtailvideos/js/video-chooser.js
View file @
67050185
...
...
@@ -4,6 +4,19 @@ function createVideoChooser(id) {
var
input
=
$
(
'
#
'
+
id
);
var
editLink
=
chooserElement
.
find
(
'
.edit-link
'
);
document
.
addEventListener
(
'
DOMContentLoaded
'
,
event
=>
{
$
.
ajax
(
window
.
chooserUrls
.
videoChooser
+
input
.
val
()).
done
(
data
=>
{
let
videoData
=
data
.
result
input
.
val
(
videoData
.
id
);
previewVideo
.
attr
({
src
:
videoData
.
preview
.
url
,
alt
:
videoData
.
title
});
chooserElement
.
removeClass
(
'
blank
'
);
editLink
.
attr
(
'
href
'
,
videoData
.
edit_link
);
});
});
$
(
'
.action-choose
'
,
chooserElement
).
click
(
function
()
{
ModalWorkflow
({
url
:
window
.
chooserUrls
.
videoChooser
,
...
...
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