Added callback method for route picker.
@@ -157,7 +157,7 @@ function genComponentConf() {
<won-route-picker
ng-if="self.openDetail === 'route'"
- initial-fromLocation="::self.draftObject.fromLcoation"
+ initial-fromLocation="::self.draftObject.fromLocation"
initial-toLocation="::self.draftObject.toLocation"
on-route-updated="::self.updateRoute(fromLocation, toLocation)">
</won-route-picker>
@@ -266,6 +266,22 @@ function genComponentConf() {
this.updateDraft();
}
+ updateRoute(fromLocation, toLocation) {
+ if (fromLocation || toLocation) {
+ if (!this.details.has("route")) {
+ this.details.add("route");
+ }
+ this.draftObject.fromLocation = fromLocation;
+ this.draftObject.toLocation = toLocation;
+ } else if (this.details.has("route")) {
+ this.details.delete("route");
+ this.draftObject.fromLocation = undefined;
+ this.draftObject.toLocation = undefined;
+ }
+
+ this.updateDraft();
+ }
+
updateTags(tags) {
if (tags && tags.length > 0) {
if (!this.details.has("tags")) {
