diff options
author | Mark Wells <mark@freeside.biz> | 2012-11-20 16:11:50 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-11-20 16:11:50 -0800 |
commit | 5ad226c0ff7759184ea26d66292ccebd2ec00af7 (patch) | |
tree | 519e281dff475619d92e8a6feb175210fdf72207 /httemplate/elements | |
parent | 044e4ea5533f1c14697b7ad408dc0cf0e0327abb (diff) |
fix a confusing standardization behavior, #13763
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/standardize_locations.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index d9c1df7e6..15c5761a0 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -1,3 +1,9 @@ +function status_message(text, caption) { + text = '<P STYLE="position:absolute; top:50%; margin-top:-1em; width:100%; text-align:center"><B><FONT SIZE="+1">' + text + '</FONT></B></P>'; + caption = caption || 'Please wait...'; + overlib(text, WIDTH, 444, HEIGHT, 168, CAPTION, caption, STICKY, AUTOSTATUSCAP, CLOSECLICK, MIDX, 0, MIDY, 0); +} + function form_address_info() { var cf = document.<% $formname %>; @@ -87,8 +93,7 @@ function standardize_locations() { % if ( $conf->config('address_standardize_method') ) { if ( changed ) { - var startup_msg = '<P STYLE="position:absolute; top:50%; margin-top:-1em; width:100%; text-align:center"><B><FONT SIZE="+1">Verifying address...</FONT></B></P>'; - overlib(startup_msg, WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSECLICK, MIDX, 0, MIDY, 0); + status_message('Verifying address...'); address_standardize(JSON.stringify(address_info), confirm_standardize); } else { @@ -116,8 +121,14 @@ function confirm_standardize(arg) { replace_address(); // with the contents of returned['new'] - } - else { + } else if ( returned['all_same'] ) { + + // then all entered address fields are correct + // but we still need to set the lat/long fields and addr_clean + status_message('Verified'); + replace_address(); + + } else { var querystring = encodeURIComponent( JSON.stringify(returned) ); // confirmation popup: knows to call replace_address(), |