/[drupal]/contributions/modules/ubercart/uc_store/uc_country_select.js
ViewVC logotype

Contents of /contributions/modules/ubercart/uc_store/uc_country_select.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Thu Jul 10 12:41:06 2008 UTC (16 months, 2 weeks ago) by islandusurper
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.5: +6 -3 lines
File MIME type: text/javascript
Begin the Ubercart 6.x-2.x branch.
1 // $Id$
2
3 $(document).ready(
4 function() {
5 $('select[@id$=-country]').change(
6 function() {
7 uc_update_zone_select(this.id, '');
8 }
9 );
10 }
11 );
12
13 function uc_update_zone_select(country_select, default_zone) {
14 var zone_select = country_select.substr(0, country_select.length - 8) + '-zone';
15
16 var options = { 'country_id' : $('#' + country_select).val() };
17
18 $('#' + zone_select).parent().siblings('.zone-throbber').attr('style', 'background-image: url(' + Drupal.settings.basePath + 'misc/throbber.gif); background-repeat: no-repeat; background-position: 100% -20px;').html('    ');
19
20 $.post(Drupal.settings.basePath + 'uc_js_util/zone_select', options,
21 function (contents) {
22 if (contents.match('value="-1"') != null) {
23 $('#' + zone_select).attr('disabled', 'disabled');
24 }
25 else {
26 $('#' + zone_select).removeAttr('disabled');
27 }
28 $('#' + zone_select).empty().append(contents).val(default_zone).change();
29 $('#' + zone_select).parent().siblings('.zone-throbber').removeAttr('style').empty();
30 }
31 );
32 }

  ViewVC Help
Powered by ViewVC 1.1.2