adding some code docs

This commit is contained in:
Shannon
2018-08-06 21:50:23 +10:00
parent 9e1b4e1c52
commit c000ef0b5c
3 changed files with 13 additions and 1 deletions

View File

@@ -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() {

View File

@@ -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 = {

View File

@@ -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: "&"
}
};