aboutsummaryrefslogtreecommitdiffstats
path: root/app/javascript
diff options
context:
space:
mode:
authorAlban Peignier2017-12-27 00:17:35 +0100
committerGitHub2017-12-27 00:17:35 +0100
commitce109f3b7ad1aefe1c120796c24535cd178f2af2 (patch)
treea021ac0f19eeeb09a912ca939e0efa13e910e3e8 /app/javascript
parenteac95acb8e7a4ab51a778e206533947e5a8fff49 (diff)
parent3b4dc7713abfd6ade94c7f09a36a14fec103401b (diff)
downloadchouette-core-ce109f3b7ad1aefe1c120796c24535cd178f2af2.tar.bz2
Merge pull request #178 from af83/5382-all-stop-types-in-routes
Enable all area types for Stopareas in Routes. Refs #5382
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/routes/components/BSelect2.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/app/javascript/routes/components/BSelect2.js b/app/javascript/routes/components/BSelect2.js
index 340d9df95..0d8d7787f 100644
--- a/app/javascript/routes/components/BSelect2.js
+++ b/app/javascript/routes/components/BSelect2.js
@@ -96,17 +96,26 @@ class BSelect2 extends Component{
data: function(params) {
return {
q: params.term,
- target_type: 'zdep'
+ scope: 'route_editor'
};
},
processResults: function(data, params) {
return {
- results: data.map(
- item => _.assign(
- {},
- item,
- { text: item.name + ", " + item.zip_code + " " + item.short_city_name + " <small><em>(" + item.user_objectid + ")</em></small>" }
- )
+ results: data.map(
+ function(item) {
+ var text = item.name;
+ if (item.zip_code || item.short_city_name) {
+ text += ","
+ }
+ if (item.zip_code) {
+ text += ` ${item.zip_code}`
+ }
+ if (item.short_city_name) {
+ text += ` ${item.short_city_name}`
+ }
+ text += ` <small><em>(${item.area_type.toUpperCase()}, ${item.user_objectid})</em></small>`;
+ return _.assign({}, item, { text: text });
+ }
)
};
},