Skip to content

Commit

Permalink
Minor JS improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
abjerner committed Jun 4, 2021
1 parent db627b9 commit 3802435
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

$scope.addLink = function (ct) {

var linkProperty = ct.getPropertyType(x => x.editor === "Skybrud.LinkPicker.Link");
var textProperty = ct.getPropertyType("text");
const linkProperty = ct.getPropertyType(x => x.editor === "Skybrud.LinkPicker.Link");
const textProperty = ct.getPropertyType("text") || ct.getPropertyType("linkText") || ct.getPropertyType("title");

if (!linkProperty) {
console.error("No property type found with editor 'Skybrud.LinkPicker.Link'");
Expand All @@ -41,7 +41,7 @@
if (!model.target || !model.target.url) return;

// Initialize the properties of the link item
var properties = {};
const properties = {};
properties[linkProperty.alias] = parseUmbracoLink(model.target);

// Populate the text property if present
Expand Down

0 comments on commit 3802435

Please sign in to comment.