diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbnodepreview.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbnodepreview.directive.js index 8d63623efb..77f6f06a30 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbnodepreview.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbnodepreview.directive.js @@ -1,3 +1,91 @@ +/** +@ngdoc directive +@name umbraco.directives.directive:umbNodePreview +@restrict E +@scope + +@description +Added in Umbraco v. 7.6: Use this directive to render a node preview. + +
++ ++ ++++ ++ +
+ (function () {
+ "use strict";
+
+ function Controller() {
+
+ var vm = this;
+
+ vm.allowRemove = true;
+ vm.allowOpen = true;
+ vm.sortable = true;
+
+ vm.nodes = [
+ {
+ "icon": "icon-document",
+ "name": "My node 1",
+ "published": true,
+ "description": "A short description of my node"
+ },
+ {
+ "icon": "icon-document",
+ "name": "My node 2",
+ "published": true,
+ "description": "A short description of my node"
+ }
+ ];
+
+ vm.remove = remove;
+ vm.open = open;
+
+ function remove(index, nodes) {
+ alert("remove node");
+ }
+
+ function open(node) {
+ alert("open node");
+ }
+
+ }
+
+ angular.module("umbraco").controller("My.NodePreviewController", Controller);
+
+ })();
+
+
+@param {string} icon (binding): The node icon.
+@param {string} name (binding): The node name.
+@param {boolean} published (binding): The node pusblished state.
+@param {string} description (binding): A short description.
+@param {boolean} sortable (binding): Will add a move cursor on the node preview. Can used in combination with ui-sortable.
+@param {boolean} allowRemove (binding): Show/Hide the remove button.
+@param {boolean} allowOpen (binding): Show/Hide the open button.
+@param {function} onRemove (expression): Callback function when the remove button is clicked.
+@param {function} onOpen (expression): Callback function when the open button is clicked.
+**/
+
(function () {
'use strict';