Skip to content
Snippets Groups Projects
Commit 4e94bbb5 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

close modal

parent 7828cd3f
No related branches found
No related tags found
No related merge requests found
/* global $ */
/* global $, bootstrap */
$('[data-unsplash]').click(function (e) {
'use strict';
var $image = $(this),
......@@ -9,7 +9,8 @@ $('[data-unsplash]').click(function (e) {
$inputId = $('#unsplashInput'),
$inputImg = $($('[data-unsplash-img]').data('unsplash-img')),
$inputAlt = $($('[data-unsplash-alt]').data('unsplash-alt')),
$inputCredit = $($('[data-unsplash-credit]').data('unsplash-credit'));
$inputCredit = $($('[data-unsplash-credit]').data('unsplash-credit')),
modal = bootstrap.Modal.getOrCreateInstance(document.querySelector('#unsplashModal'));
e.stopPropagation();
$('[data-unsplash]').removeClass('bg-secondary');
$image.addClass('bg-secondary');
......@@ -17,4 +18,5 @@ $('[data-unsplash]').click(function (e) {
$inputImg.attr('src', preview);
$inputAlt.val(alt);
$inputCredit.summernote('code', credit);
modal.hide();
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment