Skip to content

Commit

Permalink
Merge pull request #259 from AtlasOfLivingAustralia/feature/issue258
Browse files Browse the repository at this point in the history
Updated to bs4 styles #258
  • Loading branch information
salomon-j authored Aug 23, 2024
2 parents 5045e20 + 1ae9fb8 commit 3380ee9
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 40 deletions.
1 change: 1 addition & 0 deletions grails-app/assets/components/javascript/multi-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ko.components.register('multi-input', {
var self = this;

self.observableValues = ko.observableArray();
self.addValueText = params.addValueText;

// This method updates the values parameter with the contents of the managed array.
function syncValues() {
Expand Down
13 changes: 8 additions & 5 deletions grails-app/assets/components/template/multi-input.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<div data-bind="foreach: observableValues">
<div class="input-append">
<span data-bind="template:{nodes:$componentTemplateNodes}"></span><span class="add-on"
data-bind="click:$parent.removeValue"><i
class="fa fa-remove"></i></span>
<div class="input-group mb-1">
<!-- ko template: { nodes: $componentTemplateNodes } -->
<!-- /ko -->
<div class="input-group-append">
<span class="input-group-text" data-bind="click:$parent.removeValue"><i class="fa fa-remove"></i></span>
</div>

</div>
</div>
<i class="fa fa-plus" data-bind="click:addValue"></i>
<span><i class="fa fa-plus" data-bind="click:addValue"></i> <span data-bind="text:addValueText || 'Click to add'"></span></span>
72 changes: 39 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@turf/convex": "^6.0.2",
"@turf/length": "^6.0.2",
"@turf/simplify": "^5.1.5",
"chromedriver": "125.0.3",
"chromedriver": "127.0.3",
"geojson2svg": "^1.2.3",
"handlebars": "^4.7.7",
"jasmine-ajax": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/integration-test/groovy/pages/MultiInput.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class MultiInput extends Module {
static content = {
addItem(required: true) { $("multi-input i.fa-plus.fa") }
inputItem(required: false) { $("multi-input input") }
removeItem(required: false) { $("multi-input span.add-on") }
removeItem(required: false) { $("multi-input span.input-group-text") }
}
}

0 comments on commit 3380ee9

Please sign in to comment.