Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
16380917
Commit
16380917
authored
Nov 16, 2020
by
Craig Norris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor inputsetter updates
Minor style updates for InputSetter page.
parent
da8e959c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
doc/development/fe_guide/droplab/plugins/input_setter.md
doc/development/fe_guide/droplab/plugins/input_setter.md
+18
-12
No files found.
doc/development/fe_guide/droplab/plugins/input_setter.md
View file @
16380917
...
@@ -6,18 +6,21 @@ info: To determine the technical writer assigned to the Stage/Group associated w
...
@@ -6,18 +6,21 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# InputSetter plugin
# InputSetter plugin
`InputSetter`
is a plugin that allows for updating DOM out of the scope of DropLab when a list item is clicked.
`InputSetter`
is a DropLab plugin that allows for updating DOM out of the scope
of DropLab when a list item is clicked.
## Usage
## Usage
Add the
`InputSetter`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
Add the
`InputSetter`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
-
`InputSetter`
r
equires a configuration value for
`input`
and
`valueAttribute`
.
-
`InputSetter`
: R
equires a configuration value for
`input`
and
`valueAttribute`
.
-
`input`
should be t
he DOM element that you want to manipulate.
-
`input`
: T
he 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
-
`valueAttribute`
: A string that's the name of an attribute on your list items
to update the
`input`
element with.
t
hat's used to get the value t
o update the
`input`
element with.
You can also set the
`InputSetter`
configuration to an array of objects, which will allow you to update multiple elements.
You can also set the
`InputSetter`
configuration to an array of objects, which
allows you to update multiple elements.
```
html
```
html
<input
id=
"input"
value=
""
>
<input
id=
"input"
value=
""
>
...
@@ -58,9 +61,12 @@ droplab.addData('trigger', [{
...
@@ -58,9 +61,12 @@ droplab.addData('trigger', [{
}]);
}]);
```
```
Above, if the second list item was clicked, it would update the
`#input`
element
In the previous code, if the second list item was clicked, it would update the
to have a
`value`
of
`1`
, it would also update the
`#div`
element's
`data-selected-id`
to
`1`
.
`#input`
element to have a
`value`
of
`1`
, it would also update the
`#div`
element's
`data-selected-id`
to
`1`
.
Optionally you can set
`inputAttribute`
to a string that is the name of an attribute on your
`input`
element that you want to update.
Optionally, you can set
`inputAttribute`
to a string that's the name of an
If you do not provide an
`inputAttribute`
,
`InputSetter`
will update the
`value`
of the
`input`
element if it is an
`INPUT`
element,
attribute on your
`input`
element that you want to update. If you don't provide
or the
`textContent`
of the
`input`
element if it is not an
`INPUT`
element.
an
`inputAttribute`
,
`InputSetter`
will update the
`value`
of the
`input`
element if it's an
`INPUT`
element, or the
`textContent`
of the
`input`
element
if it isn't an
`INPUT`
element.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment