summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Alakkad <aalakkad@gitlab.com>2019-07-09 13:11:36 +0000
committerAmmar Alakkad <aalakkad@gitlab.com>2019-07-09 13:11:36 +0000
commitfeb2e0fc9be618412357ad590c9fc770b94f1131 (patch)
treee5bf2199df37ce726810ecbbad1a0b1a8f467dd9
parent8ae4e24255f75e25ddb0a594244b0e4eba8ebd80 (diff)
downloadgitlab-ce-aalakkad-master-patch-20574.tar.gz
Update doc/development/fe_guide/design_patterns.mdaalakkad-master-patch-20574
-rw-r--r--doc/development/fe_guide/design_patterns.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/development/fe_guide/design_patterns.md b/doc/development/fe_guide/design_patterns.md
index 0342d16a87c..2f372f783f5 100644
--- a/doc/development/fe_guide/design_patterns.md
+++ b/doc/development/fe_guide/design_patterns.md
@@ -53,6 +53,7 @@ When writing a class that needs to manipulate the DOM guarantee a container opti
This is useful when we need that class to be instantiated more than once in the same page.
Bad:
+
```javascript
class Foo {
constructor() {
@@ -63,6 +64,7 @@ new Foo();
```
Good:
+
```javascript
class Foo {
constructor(opts) {
@@ -72,6 +74,7 @@ class Foo {
new Foo({ container: '.my-element' });
```
+
You can find an example of the above in this [class][container-class-example];
[container-class-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/mini_pipeline_graph_dropdown.js