summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components/environment_item.js.es6
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-10-20 17:43:52 +0100
committerFilipa Lacerda <filipa@gitlab.com>2016-11-16 11:57:54 +0000
commite4ff8dd2f100daaec614881c2b2733a92f4ec4d8 (patch)
tree106c5fcad7665c343c7d85b4101612a6c62bef4f /app/assets/javascripts/environments/components/environment_item.js.es6
parent96152f17d115a08726bfd1322d0dba33fe5cd211 (diff)
downloadgitlab-ce-e4ff8dd2f100daaec614881c2b2733a92f4ec4d8.tar.gz
Recursive component
Diffstat (limited to 'app/assets/javascripts/environments/components/environment_item.js.es6')
-rw-r--r--app/assets/javascripts/environments/components/environment_item.js.es611
1 files changed, 5 insertions, 6 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.js.es6 b/app/assets/javascripts/environments/components/environment_item.js.es6
index 3e43c64139a..71463bd1748 100644
--- a/app/assets/javascripts/environments/components/environment_item.js.es6
+++ b/app/assets/javascripts/environments/components/environment_item.js.es6
@@ -5,8 +5,7 @@
*
* Used in a hierarchical structure to show folders with children
* in a table.
- * Based on [Tree View](https://vuejs.org/examples/tree-view.html)
- * The template used in this Component is non recursive.
+ * Recursive component based on [Tree View](https://vuejs.org/examples/tree-view.html)
*
* See this [issue](https://gitlab.com/gitlab-org/gitlab-ce/issues/22539)
* for more information.
@@ -17,7 +16,7 @@
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
- gl.environmentsList.EnvironmentItem = Vue.extend({
+ gl.environmentsList.EnvironmentItem = Vue.component("environment-item", {
template: '#environment-item-template',
@@ -25,7 +24,7 @@
model: Object
},
- data: function () {
+ data () {
return {
open: false
};
@@ -40,7 +39,7 @@
*
* @returns {Number} The length of the children array
*/
- isFolder: function () {
+ isFolder () {
return this.model.children && this.model.children.length
}
},
@@ -50,7 +49,7 @@
/**
* Toggles the visibility of a folders' children.
*/
- toggle: function () {
+ toggle () {
if (this.isFolder) {
this.open = !this.open;
}