diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-18 17:48:47 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-18 17:48:47 +0100 |
commit | f5e91ee2812ee3825844c5bdbe0fa6e6bed3457a (patch) | |
tree | a02f6281995e6aa769c8dce10c894e85e43de55d | |
parent | a83a2102fc24eec7338ee9ab459b7cbe3b6f3a94 (diff) | |
download | gitlab-ce-add-droplab-docs.tar.gz |
Remove remaining script tags and add remaining listsadd-droplab-docs
-rw-r--r-- | doc/development/fe_guide/droplab/plugins/ajax.md | 14 | ||||
-rw-r--r-- | doc/development/fe_guide/droplab/plugins/filter.md | 10 | ||||
-rw-r--r-- | doc/development/fe_guide/droplab/plugins/input_setter.md | 13 | ||||
-rw-r--r-- | doc/development/fe_guide/index.md | 7 |
4 files changed, 19 insertions, 25 deletions
diff --git a/doc/development/fe_guide/droplab/plugins/ajax.md b/doc/development/fe_guide/droplab/plugins/ajax.md index 40c256f83ed..9c7e56fa448 100644 --- a/doc/development/fe_guide/droplab/plugins/ajax.md +++ b/doc/development/fe_guide/droplab/plugins/ajax.md @@ -8,17 +8,16 @@ Add the `Ajax` object to the plugins array of a `DropLab.prototype.init` or `Dro `Ajax` requires 2 config values, the `endpoint` and `method`. -`endpoint` should be a URL to the request endpoint. - -`method` should be `setData` or `addData`. -`setData` completely replaces the dropdown with the response data. -`addData` appends the response data to the current dropdown list. +* `endpoint` should be a URL to the request endpoint. +* `method` should be `setData` or `addData`. +* `setData` completely replaces the dropdown with the response data. +* `addData` appends the response data to the current dropdown list. ```html <a href="#" id="trigger" data-dropdown-trigger="#list">Toggle</a> <ul id="list" data-dropdown><!-- ... --><ul> - -<script> +``` +```js const droplab = new DropLab(); const trigger = document.getElementById('trigger'); @@ -30,7 +29,6 @@ Add the `Ajax` object to the plugins array of a `DropLab.prototype.init` or `Dro method: 'setData', }, }); -</script> ``` Optionally you can set `loadingTemplate` to a HTML string. This HTML string will diff --git a/doc/development/fe_guide/droplab/plugins/filter.md b/doc/development/fe_guide/droplab/plugins/filter.md index faab348f1ae..0853ea4d320 100644 --- a/doc/development/fe_guide/droplab/plugins/filter.md +++ b/doc/development/fe_guide/droplab/plugins/filter.md @@ -7,9 +7,8 @@ to the dropdown using a simple fuzzy string search of an input value. Add the `Filter` object to the plugins array of a `DropLab.prototype.init` or `DropLab.prototype.addHook` call. -`Filter` requires a config value for `template`. - -`template` should be the key of the objects within your data array that you want to compare +* `Filter` requires a config value for `template`. +* `template` should be the key of the objects within your data array that you want to compare to the user input string, for filtering. ```html @@ -17,8 +16,8 @@ to the user input string, for filtering. <ul id="list" data-dropdown data-dynamic> <li><a href="#" data-id="{{id}}">{{text}}</a></li> <ul> - -<script> +``` +```js const droplab = new DropLab(); const trigger = document.getElementById('trigger'); @@ -37,7 +36,6 @@ to the user input string, for filtering. id: 1, text: 'Jeff', }]); -</script> ``` Above, the input string will be compared against the `test` key of the passed data objects. diff --git a/doc/development/fe_guide/droplab/plugins/input_setter.md b/doc/development/fe_guide/droplab/plugins/input_setter.md index 7f313dcfa3b..a549603c20d 100644 --- a/doc/development/fe_guide/droplab/plugins/input_setter.md +++ b/doc/development/fe_guide/droplab/plugins/input_setter.md @@ -6,11 +6,9 @@ Add the `InputSetter` object to the plugins array of a `DropLab.prototype.init` or `DropLab.prototype.addHook` call. -`InputSetter` requires a config value for `input` and `valueAttribute`. - -`input` should be the DOM element that you want to manipulate. - -`valueAttribute` should be a string that is the name of an attribute on your list items that is used to get the value +* `InputSetter` requires a config value for `input` and `valueAttribute`. +* `input` should be the DOM element that you want to manipulate. +* `valueAttribute` should be a string that is the name of an attribute on your list items that is used to get the value to update the `input` element with. You can also set the `InputSetter` config to an array of objects, which will allow you to update multiple elements. @@ -24,8 +22,8 @@ You can also set the `InputSetter` config to an array of objects, which will all <ul id="list" data-dropdown data-dynamic> <li><a href="#" data-id="{{id}}">{{text}}</a></li> <ul> - -<script> +``` +```js const droplab = new DropLab(); const trigger = document.getElementById('trigger'); @@ -52,7 +50,6 @@ You can also set the `InputSetter` config to an array of objects, which will all id: 1, text: 'Jeff', }]); -</script> ``` Above, if the second list item was clicked, it would update the `#input` element diff --git a/doc/development/fe_guide/index.md b/doc/development/fe_guide/index.md index 6834e9bbaf4..c7d4f2e9c23 100644 --- a/doc/development/fe_guide/index.md +++ b/doc/development/fe_guide/index.md @@ -96,6 +96,7 @@ Our accessibility standards and resources. ## [DropLab](droplab/droplab.md) Our internal `DropLab` dropdown library. -[Ajax plugin](droplab/plugins/ajax.md) -[Filter plugin](droplab/plugins/filter.md) -[InputSetter plugin](droplab/plugins/input_setter.md) +* [DropLab](droplab/droplab.md) +* [Ajax plugin](droplab/plugins/ajax.md) +* [Filter plugin](droplab/plugins/filter.md) +* [InputSetter plugin](droplab/plugins/input_setter.md) |