summernote-list-of-links
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "summernote-list-of-links", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A plugin for the Summernote WYSIWYG editor, that lets you choose from an external list of links, provided as json.", | ||
@@ -5,0 +5,0 @@ "main": "summernote-list-of-links.js", |
@@ -53,15 +53,20 @@ /** | ||
this.loadList = function() { | ||
if (self.data === undefined && listUrl !== undefined) { | ||
$.get(listUrl, function(data) { | ||
self.data = data; | ||
$.each(data, function(key, value) { | ||
var url = value[0]; | ||
var label = value[1]; | ||
$('.note-link-list').append($('<option>', { | ||
value: url, | ||
text : label | ||
})); | ||
}); | ||
}) | ||
} | ||
return $.Deferred(function(deferred) { | ||
if (self.data === undefined && listUrl !== undefined) { | ||
$.get(listUrl, function(data) { | ||
self.data = data; | ||
$.each(data, function(key, value) { | ||
var url = value[0]; | ||
var label = value[1]; | ||
$('.note-link-list').append($('<option>', { | ||
value: url, | ||
text : label | ||
})); | ||
deferred.resolve(); | ||
}); | ||
}) | ||
} else { | ||
deferred.resolve(); | ||
} | ||
}); | ||
} | ||
@@ -91,10 +96,9 @@ | ||
this.loadList(); | ||
this.showLinkDialog(linkInfo).then(function (linkInfo) { | ||
context.invoke('editor.restoreRange'); | ||
context.invoke('editor.createLink', linkInfo); | ||
}).fail(function () { | ||
context.invoke('editor.restoreRange'); | ||
this.loadList().then(function() { | ||
self.showLinkDialog(linkInfo).then(function (linkInfo) { | ||
context.invoke('editor.restoreRange'); | ||
context.invoke('editor.createLink', linkInfo); | ||
}).fail(function () { | ||
context.invoke('editor.restoreRange'); | ||
}); | ||
}); | ||
@@ -101,0 +105,0 @@ }; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8708
127