Move ZIP to separate box for more reliable/easier address geocoding
This commit is contained in:
parent
b587281315
commit
4e7d2af957
@ -41,12 +41,17 @@ $("#addpackagebtn").click(function () {
|
||||
setStorage("citystate", $("input[name=citystate]").val().trim());
|
||||
}
|
||||
|
||||
if (getStorage("zipcode") != $("input[name=zipcode]").val().trim()) {
|
||||
setStorage("zipcode", $("input[name=zipcode]").val().trim());
|
||||
}
|
||||
|
||||
var address = ($("input[name=number]").val() + " " + $("input[name=street]").val()).toUpperCase();
|
||||
$("#no-history").addClass("display-none");
|
||||
addPackageByAddress(
|
||||
$("input[name=number]").val().toUpperCase(),
|
||||
$("input[name=street]").val().toUpperCase(),
|
||||
$("input[name=citystate]").val().toUpperCase(),
|
||||
$("input[name=zipcode]").val().toUpperCase(),
|
||||
$("input[name=itemtype]:checked").val(),
|
||||
function (ids) {
|
||||
var packageObj = getPackage(ids.packageID);
|
||||
@ -82,6 +87,9 @@ $(".view-main").on("click", "#historylist .history-list-item", function () {
|
||||
});
|
||||
|
||||
// Restore user's last entered city/state combo
|
||||
if (getStorage("citystate") != null) {
|
||||
if (inStorage("citystate")) {
|
||||
$("input[name=citystate]").val(getStorage("citystate"));
|
||||
}
|
||||
if (inStorage("zipcode")) {
|
||||
$("input[name=zipcode]").val(getStorage("zipcode"));
|
||||
}
|
@ -284,7 +284,7 @@ function countPackages() {
|
||||
return count;
|
||||
}
|
||||
|
||||
function addPackageByAddress(number, street, citystate, type, callback) {
|
||||
function addPackageByAddress(number, street, citystate, zip, type, callback) {
|
||||
var requestfinished = false;
|
||||
var searchingdialogopen = false;
|
||||
var deadline = false;
|
||||
@ -318,7 +318,8 @@ function addPackageByAddress(number, street, citystate, type, callback) {
|
||||
data: {
|
||||
number: number,
|
||||
street: street,
|
||||
citystate: citystate
|
||||
citystate: citystate,
|
||||
zip: zip
|
||||
},
|
||||
timeout: 15 * 1000,
|
||||
success: function (resp) {
|
||||
|
@ -55,11 +55,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content item-input">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-label">City, State, ZIP</div>
|
||||
<div class="item-input-wrap">
|
||||
<input type="text" name="citystate" placeholder="City, ST, 12345" value="" autocomplete="off" autocorrect="off">
|
||||
<li>
|
||||
<div class="row">
|
||||
<div class="col-100 xsmall-75 item-content item-input">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-label">City, State</div>
|
||||
<div class="item-input-wrap">
|
||||
<input type="text" name="citystate" placeholder="City, ST" value="" autocomplete="off" autocorrect="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-100 xsmall-25 item-content item-input">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-label">ZIP</div>
|
||||
<div class="item-input-wrap">
|
||||
<input type="text" name="zipcode" placeholder="12345" value="" autocomplete="off" autocorrect="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@ -68,7 +80,7 @@
|
||||
<li>
|
||||
<label class="item-radio item-content">
|
||||
<input type="radio" name="itemtype" value="{{id}}" {{#if selected}}data-default="1" checked{{/if}} />
|
||||
<i class="icon icon-radio"></i>
|
||||
<i class="icon icon-radio"></i>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><i class="{{icon}}"></i> {{name}}</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user