Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fallback URLs for the "umbNodePreview" directive #2369

Merged
merged 7 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
// make sure dates are formatted to the user's locale
formatDatesToLocal();

// Declare a fallback URL for the <umb-node-preview/> directive
scope.previewOpenUrl = '#/settings/documenttypes/edit/' + scope.documentType.id;

setNodePublishStatus(scope.node);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
@param {function} onRemove (<code>expression</code>): Callback function when the remove button is clicked.
@param {function} onOpen (<code>expression</code>): Callback function when the open button is clicked.
@param {function} onEdit (<code>expression</code>): Callback function when the edit button is clicked (Added in version 7.7.0).
@param {string} openUrl (<code>binding</code>): Fallback URL for <code>onOpen</code> (Added in version 7.12.0).
@param {string} editUrl (<code>binding</code>): Fallback URL for <code>onEdit</code> (Added in version 7.12.0).
@param {string} removeUrl (<code>binding</code>): Fallback URL for <code>onRemove</code> (Added in version 7.12.0).
**/

(function () {
Expand Down Expand Up @@ -122,7 +125,10 @@
allowEdit: "=?",
onOpen: "&?",
onRemove: "&?",
onEdit: "&?"
onEdit: "&?",
openUrl: '=?',
editUrl: '=?',
removeUrl: '=?'
},
link: link
};
Expand All @@ -133,4 +139,4 @@

angular.module('umbraco.directives').directive('umbNodePreview', NodePreviewDirective);

})();
})();
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,13 @@
</umb-control-group>

<umb-control-group data-element="node-info-document-type" label="@content_documentType">
<umb-node-preview style="max-width: 100%; margin-bottom: 0;"
icon="documentType.icon"
name="documentType.name"
alias="documentType.alias"
allow-open="allowOpen"
on-open="openDocumentType(documentType)">
<umb-node-preview
style="max-width: 100%; margin-bottom: 0;"
icon="documentType.icon"
name="documentType.name"
allow-open="allowOpen"
on-open="openDocumentType(documentType)"
open-url="previewOpenUrl">
</umb-node-preview>
</umb-control-group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</div>
</div>
<div class="umb-node-preview__actions">
<a class="umb-node-preview__action" title="Edit" href="" ng-if="allowEdit" ng-click="onEdit()"><localize key="general_edit">Edit</localize></a>
<a class="umb-node-preview__action" title="Open" href="" ng-if="allowOpen" ng-click="onOpen()"><localize key="general_open">Open</localize></a>
<a class="umb-node-preview__action umb-node-preview__action--red" title="Remove" href="" ng-if="allowRemove" ng-click="onRemove()"><localize key="general_remove">Remove</localize></a>
<a class="umb-node-preview__action" title="Open" href="{{editUrl}}" ng-if="allowEdit" ng-click="onEdit()"><localize key="general_edit">Edit</localize></a>
<a class="umb-node-preview__action" title="Open" href="{{openUrl}}" ng-if="allowOpen" ng-click="onOpen()"><localize key="general_open">Open</localize></a>
<a class="umb-node-preview__action umb-node-preview__action--red" title="Remove" href="{{removeUrl}}" ng-if="allowRemove" ng-click="onRemove()"><localize key="general_remove">Remove</localize></i></a>
</div>

</div>