From c000ef0b5ce21f13931742ae56f43298e4d0cd3c Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 6 Aug 2018 21:50:23 +1000 Subject: [PATCH] adding some code docs --- .../directives/components/content/edit.controller.js | 2 +- .../components/content/tabbedcontent.directive.js | 1 + .../components/content/variantcontent.directive.js | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 3fda284a11..cce75d11ce 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -62,7 +62,7 @@ } /** - * The content item(s) are loaded into an array and this will set the active content item based on the current culture. + * The content item(s) are loaded into an array and this will set the active content item based on the current culture (query string). * If the content item is invariant, then only one item exists in the array. */ function setActiveCulture() { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/tabbedcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/tabbedcontent.directive.js index 3b4dabda5f..7e097f6082 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/tabbedcontent.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/tabbedcontent.directive.js @@ -1,6 +1,7 @@ (function () { 'use strict'; + /** This directive is used to render out the current variant tabs and properties and exposes an API for other directives to consume */ function tabbedContentDirective() { var directive = { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/variantcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/variantcontent.directive.js index 813bf81cee..b362b822fc 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/variantcontent.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/variantcontent.directive.js @@ -14,6 +14,10 @@ templateUrl: 'views/components/content/variant-content.html', link: function (scope) { + /** + * Adds a new editor to the editors array to show content in a split view + * @param {any} selectedVariant + */ scope.openInSplitView = function (selectedVariant) { var selectedCulture = selectedVariant.language.culture; @@ -52,6 +56,10 @@ }, 100); }; + /** + * Changes the currently selected variant + * @param {any} variantDropDownItem + */ scope.selectVariant = function (variantDropDownItem) { var editorIndex = _.findIndex(scope.editors, function (e) { @@ -79,6 +87,7 @@ } }; + /** Closes the split view */ scope.closeSplitView = function () { //TODO: hacking animation states - these should hopefully be easier to do when we upgrade angular scope.editor.loading = true; @@ -105,6 +114,8 @@ content: "=", editor: "=", editors: "=", + //TODO: I don't like having this callback defined and would like to make this directive a bit less + // coupled but right now don't have time initVariant: "&" } };