Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Update the drop down default
Browse files Browse the repository at this point in the history
don't allow to remove link
update styling
  • Loading branch information
mjbarlow committed Dec 13, 2020
1 parent 1be4981 commit 67e07de
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@
overflow: hidden;
font-size: 13px;
margin-top: 0;
max-width: 125px;
overflow: hidden;
}

.list-view-falink__link .umb-node-preview__description {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
published="link.published"
description="link.url + (link.queryString ? link.queryString : '')"
sortable="false"
allow-remove="true"
allow-remove="false"
allow-edit="true"
on-remove="removeLink(item)"
on-edit="openLinkPicker(item, link)">
Expand All @@ -46,14 +46,11 @@
</div>
<div ng-show="model.config.primaryClassItems.length > 0" class="list-view-falink__dropdown">
<select name="dropDownList" class="umb-property-editor umb-dropdown -full-width-input" ng-model="item.primaryClass">
<option value="" selected></option>
<option ng-repeat="option in model.config.primaryClassItems" ng-value="option.value">{{option.name}}</option>
</select>
</div>
<div ng-show="model.config.secondaryClassItems.length > 0" class="list-view-falink__dropdown">
<select name="dropDownList" class="umb-property-editor umb-dropdown -full-width-input"
ng-model="item.secondaryClass">
<option value="" selected></option>
<select name="dropDownList" class="umb-property-editor umb-dropdown -full-width-input" ng-model="item.secondaryClass">
<option ng-repeat="option in model.config.secondaryClassItems" ng-value="option.value">{{option.name}}</option>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
editorService.open(faPicker);
};

$scope.removeIcon = function(item) {
$scope.removeIcon = function (item) {
item.svg = "";
item.className = "";
item.label = "";
Expand All @@ -89,17 +89,17 @@
} : null;

const linkPicker = {

currentTarget: target,
submit: function (model) {
if (model.target.url || model.target.anchor) {

if (model.target.anchor && model.target.anchor[0] !== "?" && model.target.anchor[0] !== "#") {
model.target.anchor = (model.target.anchor.indexOf("=") === -1 ? "#" : "?") + model.target.anchor;
}
if (link) {
if (link.isMedia && link.url === model.target.url) {

} else {
link.udi = model.target.udi;
link.isMedia = model.target.isMedia;
Expand All @@ -112,13 +112,13 @@
} else {
link = {
isMedia: model.target.isMedia,
name: model.target.name || model.target.url || model.target.anchor,
name: model.target.name || model.target.url || model.target.anchor,
queryString: model.target.anchor,
target: model.target.target,
udi: model.target.udi,
url: model.target.url
};
item.link = [];
item.link = [];
item.link.push(link);
}

Expand All @@ -129,8 +129,8 @@
link.icon = iconHelper.convertFromLegacyIcon(data.icon);
link.published =
(data.metaData && data.metaData.IsPublished === false && entityType === "Document")
? false
: true;
? false
: true;
link.trashed = data.trashed;
if (link.trashed) {
item.url = localizationService.dictionary.general_recycleBin;
Expand Down Expand Up @@ -170,15 +170,15 @@
else {
$scope.faLinksForm.maxCount.$setValidity("maxCount", true);
}
vm.sortableOptions.disabled = $scope.model.value.length === 1;
vm.sortableOptions.disabled = $scope.model.value.length === 1;
}
);

$scope.removeLink = function (item) {
item.link = [];
};

vm.init = function() {
vm.init = function () {
if ($scope.model.config && $scope.model.config.hideIconPicker) {
vm.hideIcon = $scope.model.config.hideIconPicker;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"propertyEditors": [
{
"alias": "FaLinksPropertyEditor",
"name": "Font Awesome Links",
"icon": "icon-link",
"group": "pickers",
"editor": {
"valueType": "TEXT",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.propertyeditor.html"
{
"alias": "FaLinksPropertyEditor",
"name": "Font Awesome Links",
"icon": "icon-link",
"group": "pickers",
"editor": {
"valueType": "TEXT",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.propertyeditor.html"
},
"prevalues": {
"fields": [
{
"label": "Minimum number of items",
"description": "",
"key": "minNumber",
"view": "number"
},
{
"label": "Maximum number of items",
"description": "",
"key": "maxNumber",
"view": "number"
},
{
"label": "Primary Class Dropdown",
"description": "Add key/value pairs for primary class dropdown",
"key": "primaryClassItems",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.prevalues.html"
},
{
"label": "Secondary Class Dropdown",
"description": "Add key/value pairs for secondary class dropdown",
"key": "secondaryClassItems",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.prevalues.html"
},
{
"label": "Hide Icon Picker",
"description": "Hide the icon picker",
"key": "hideIconPicker",
"view": "boolean"
}
]
}
},
"prevalues": {
"fields": [
{
"label": "Minimum number of items",
"description": "",
"key": "minNumber",
"view": "number"
},
{
"label": "Maximum number of items",
"description": "",
"key": "maxNumber",
"view": "number"
},
{
"label": "Primary Class Dropdown",
"description": "Add key/value pairs for primary class dropdown",
"key": "primaryClassItems",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.prevalues.html"
},
{
"label": "Secondary Class Dropdown",
"description": "Add key/value pairs for secondary class dropdown",
"key": "secondaryClassItems",
"view": "~/App_Plugins/FaLinksPropertyEditor/falinks.prevalues.html"
},
{
"label": "Hide Icon Picker",
"description": "Hide the icon picker",
"key": "hideIconPicker",
"view": "boolean"
}
]
}
},
{
"alias": "FaIconPropertyEditor",
"name": "Font Awesome Icon",
Expand Down

0 comments on commit 67e07de

Please sign in to comment.