Skip to content

Commit

Permalink
Merge pull request #1334 from IvanDreamer/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D authored Oct 4, 2022
2 parents 6b36d13 + 599562e commit fb35764
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions plugins/noembed/trumbowyg.noembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,21 @@
cache: false,
dataType: 'json',

success: trumbowyg.o.plugins.noembed.success || function (data) {
if (data.html) {
trumbowyg.execCmd('insertHTML', data.html);
setTimeout(function () {
trumbowyg.closeModal();
}, 250);
success: function (data) {
if (trumbowyg.o.plugins.noembed.success) {
trumbowyg.o.plugins.noembed.success(data, trumbowyg, $modal)
} else {
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
data.error
);
if (data.html) {
trumbowyg.execCmd('insertHTML', data.html);
setTimeout(function () {
trumbowyg.closeModal();
}, 250);
} else {
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
data.error
);
}
}
},
error: trumbowyg.o.plugins.noembed.error || function () {
Expand Down

0 comments on commit fb35764

Please sign in to comment.