Fix couple of issues regarding AB country and region selections:

- Use taglist-state widget for US state selector
- Make sure falg class only gets added for select-country widget
- Fix some styling
This commit is contained in:
Hadi Nategh 2018-09-24 13:48:24 +02:00
parent 613a49799c
commit 2010850c16
5 changed files with 64 additions and 29 deletions

View File

@ -89,10 +89,19 @@ input.et2_radiobox {
top: 0; top: 0;
padding-top: 0; padding-top: 0;
} }
#addressbook-edit_adr_one_locality,#addressbook-edit_adr_two_locality { #addressbook-edit_adr_one_locality,
margin-left:5px; #addressbook-edit_adr_two_locality,
#addressbook-edit_adr_one_postalcode,
#addressbook-edit_adr_two_postalcode{
padding-top:5px;
padding-bottom: 5px;
} }
#addressbook-edit_adr_one_postalcode,
#addressbook-edit_adr_two_postalcode{
margin-right: -4px;
}
div.city_state_postcode #addressbook-edit_adr_two_postalcode,
div.city_state_postcode #addressbook-edit_adr_one_postalcode {margin-right: 5px !important;}
#addressbook-edit_role { #addressbook-edit_role {
margin-right: 5px; margin-right: 5px;
} }
@ -122,3 +131,8 @@ select#addressbook-index_col_filter\[tid\] {
#addressbook-edit .chzn-container .chzn-results {max-height: 110px} #addressbook-edit .chzn-container .chzn-results {max-height: 110px}
#addressbook-index_nm .chzn-drop {width:auto;} #addressbook-index_nm .chzn-drop {width:auto;}
#addressbook-edit_adr_one_region, #addressbook-edit_adr_two_region {
width: 130px;
vertical-align: middle;
margin-left: 3px;
}

View File

@ -71,7 +71,7 @@
<url-phone id="tel_assistent" tabindex="23" class="et2_fullWidth"/> <url-phone id="tel_assistent" tabindex="23" class="et2_fullWidth"/>
<radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_assistent,&amp;hearts;"/> <radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_assistent,&amp;hearts;"/>
<description for="adr_one_locality" value="city" /> <description for="adr_one_locality" value="city" />
<hbox> <hbox class="city_state_postcode">
<textbox statustext="ZIP Code" id="adr_one_postalcode" tabindex="13" width="24%" maxlength="64" autocomplete="postal-code"/> <textbox statustext="ZIP Code" id="adr_one_postalcode" tabindex="13" width="24%" maxlength="64" autocomplete="postal-code"/>
<textbox statustext="City" id="adr_one_locality" tabindex="14" maxlength="64" width="70%" autocomplete="address-level2"/> <textbox statustext="City" id="adr_one_locality" tabindex="14" maxlength="64" width="70%" autocomplete="address-level2"/>
</hbox> </hbox>
@ -82,7 +82,7 @@
<url-phone id="tel_fax" tabindex="24" class="et2_fullWidth" autocomplete="fax" /> <url-phone id="tel_fax" tabindex="24" class="et2_fullWidth" autocomplete="fax" />
<radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_fax,&amp;hearts;"/> <radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_fax,&amp;hearts;"/>
<description for="adr_one_countryname" value="country"/> <description for="adr_one_countryname" value="country"/>
<vbox width="100%"> <vbox class="city_state_postcode" width="100%">
<menulist class="et2_fullWidth"> <menulist class="et2_fullWidth">
<menupopup type="select-country" submit="1" tags="true" width="100%" class="countrySelect et2_fullWidth" id="adr_one_countrycode" tabindex="15" onchange="app.addressbook.show_custom_country(this);" options="Select one,0,1" autocomplete="country"/> <menupopup type="select-country" submit="1" tags="true" width="100%" class="countrySelect et2_fullWidth" id="adr_one_countrycode" tabindex="15" onchange="app.addressbook.show_custom_country(this);" options="Select one,0,1" autocomplete="country"/>
</menulist> </menulist>
@ -95,7 +95,7 @@
<url-phone id="tel_other" tabindex="25" class="et2_fullWidth" autocomplete="tel" /> <url-phone id="tel_other" tabindex="25" class="et2_fullWidth" autocomplete="tel" />
<radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_other,&amp;hearts;"/> <radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_other,&amp;hearts;"/>
<description value="Region"/> <description value="Region"/>
<taglist-state statustext="State" maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_one_countrycode]" id="adr_one_region" tabindex="16" maxlength="64" class="et2_fullWidth" autocomplete="address-level1"/> <taglist-state class="city_state_postcode et2_fullWidth" statustext="State" maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_one_countrycode]" id="adr_one_region" tabindex="16" maxlength="64"/>
<description/> <description/>
</row> </row>
<row disabled="!@addr_format=city_state_postcode"> <row disabled="!@addr_format=city_state_postcode">
@ -105,7 +105,7 @@
<description value="City"/> <description value="City"/>
<hbox> <hbox>
<textbox statustext="City" id="adr_one_locality" size="30" maxlength="64" tabindex="13" autocomplete="address-level2"/> <textbox statustext="City" id="adr_one_locality" size="30" maxlength="64" tabindex="13" autocomplete="address-level2"/>
<textbox statustext="State" id="adr_one_region" size="3" maxlength="64" tabindex="14" autocomplete="address-level1"/> <taglist-state statustext="State" maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_one_countrycode]" id="adr_one_region" tabindex="14" width="130"/>
<textbox statustext="ZIP Code" id="adr_one_postalcode" size="5" maxlength="64" tabindex="15" autocomplete="postal-code"/> <textbox statustext="ZIP Code" id="adr_one_postalcode" size="5" maxlength="64" tabindex="15" autocomplete="postal-code"/>
</hbox> </hbox>
<description/> <description/>
@ -227,7 +227,7 @@
<url-phone id="tel_fax_home" tabindex="29" class="et2_fullWidth" autocomplete="section-two fax tel" /> <url-phone id="tel_fax_home" tabindex="29" class="et2_fullWidth" autocomplete="section-two fax tel" />
<radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_fax_home,&amp;hearts;"/> <radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_fax_home,&amp;hearts;"/>
<description for="adr_two_locality" value="city"/> <description for="adr_two_locality" value="city"/>
<hbox> <hbox class="city_state_postcode">
<textbox statustext="ZIP Code" id="adr_two_postalcode" tabindex="34" width="24%" maxlength="64" autocomplete="section-two postal-code" /> <textbox statustext="ZIP Code" id="adr_two_postalcode" tabindex="34" width="24%" maxlength="64" autocomplete="section-two postal-code" />
<textbox statustext="City" id="adr_two_locality" maxlength="64" tabindex="36" width="70%" autocomplete="section-two address-level2" /> <textbox statustext="City" id="adr_two_locality" maxlength="64" tabindex="36" width="70%" autocomplete="section-two address-level2" />
</hbox> </hbox>
@ -238,7 +238,7 @@
<url-phone id="tel_pager" tabindex="30" class="et2_fullWidth"/> <url-phone id="tel_pager" tabindex="30" class="et2_fullWidth"/>
<radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_pager,&amp;hearts;"/> <radio statustext="select phone number as prefered way of contact" id="tel_prefer" options="tel_pager,&amp;hearts;"/>
<description for="adr_two_countryname" value="country"/> <description for="adr_two_countryname" value="country"/>
<vbox width="100%"> <vbox width="100%" class="city_state_postcode">
<menulist class="et2_fullWidth"> <menulist class="et2_fullWidth">
<menupopup type="select-country" tabindex="37" tags="true" width="100%" class="countrySelect et2_fullWidth" id="adr_two_countrycode" onchange="app.addressbook.show_custom_country(this);" options="Select one,0,1" autocomplete="section-two country" /> <menupopup type="select-country" tabindex="37" tags="true" width="100%" class="countrySelect et2_fullWidth" id="adr_two_countrycode" onchange="app.addressbook.show_custom_country(this);" options="Select one,0,1" autocomplete="section-two country" />
</menulist> </menulist>
@ -251,7 +251,7 @@
<date id="bday" tabindex="31" options="Y-m-d" year_range="c-90:c+2" class="et2_fullWidth"/> <date id="bday" tabindex="31" options="Y-m-d" year_range="c-90:c+2" class="et2_fullWidth"/>
<description/> <description/>
<description value="Region"/> <description value="Region"/>
<taglist-state statustext="State" maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_two_region]" id="adr_two_region" tabindex="38" maxlength="64" class="et2_fullWidth" autocomplete="section-two address-level1" /> <taglist-state statustext="State" maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_two_countrycode]" id="adr_two_region" tabindex="38" maxlength="64" class="et2_fullWidth city_state_postcode"/>
<description/> <description/>
</row> </row>
<row disabled="!@addr_format=city_state_postcode"> <row disabled="!@addr_format=city_state_postcode">
@ -261,7 +261,7 @@
<description value="City"/> <description value="City"/>
<hbox> <hbox>
<textbox statustext="City" id="adr_two_locality" size="30" maxlength="64" autocomplete="section-two address-level2" /> <textbox statustext="City" id="adr_two_locality" size="30" maxlength="64" autocomplete="section-two address-level2" />
<textbox statustext="State" id="adr_two_region" size="3" maxlength="64" autocomplete="section-two address-level1"/> <taglist-state maxSelection="1" multiple="toggle" editModeEnabled="false" country_code="$cont[adr_one_countrycode]" statustext="State" id="adr_two_region" width="130" autocomplete="section-two address-level1"/>
<textbox statustext="ZIP Code" id="adr_two_postalcode" size="5" maxlength="64" autocomplete="section-two postal-code" /> <textbox statustext="ZIP Code" id="adr_two_postalcode" size="5" maxlength="64" autocomplete="section-two postal-code" />
</hbox> </hbox>
<description/> <description/>

View File

@ -108,8 +108,19 @@ input.et2_radiobox {
padding-top: 0; padding-top: 0;
} }
#addressbook-edit_adr_one_locality, #addressbook-edit_adr_one_locality,
#addressbook-edit_adr_two_locality { #addressbook-edit_adr_two_locality,
margin-left: 5px; #addressbook-edit_adr_one_postalcode,
#addressbook-edit_adr_two_postalcode {
padding-top: 5px;
padding-bottom: 5px;
}
#addressbook-edit_adr_one_postalcode,
#addressbook-edit_adr_two_postalcode {
margin-right: -4px;
}
div.city_state_postcode #addressbook-edit_adr_two_postalcode,
div.city_state_postcode #addressbook-edit_adr_one_postalcode {
margin-right: 5px !important;
} }
#addressbook-edit_role { #addressbook-edit_role {
margin-right: 5px; margin-right: 5px;
@ -146,6 +157,12 @@ select#addressbook-index_col_filter\[tid\] {
#addressbook-index_nm .chzn-drop { #addressbook-index_nm .chzn-drop {
width: auto; width: auto;
} }
#addressbook-edit_adr_one_region,
#addressbook-edit_adr_two_region {
width: 130px;
vertical-align: middle;
margin-left: 3px;
}
@media all { @media all {
/* ############################################################################# /* #############################################################################

View File

@ -239,6 +239,9 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
var valid = this._super.apply(this, arguments); var valid = this._super.apply(this, arguments);
var selected = this.input.siblings().find('a.chzn-single'); var selected = this.input.siblings().find('a.chzn-single');
var val = _value && _value.selected ? _value.selected : this.value; var val = _value && _value.selected ? _value.selected : this.value;
switch (this._type)
{
case 'select-country':
if (selected && selected.length == 1 && val) if (selected && selected.length == 1 && val)
{ {
selected.removeClass (function (index, className) { selected.removeClass (function (index, className) {
@ -252,6 +255,8 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
{ {
selected.removeClass('et2_country-select'); selected.removeClass('et2_country-select');
} }
break;
}
return valid; return valid;
}, },

View File

@ -1131,6 +1131,7 @@ table.egwGridView_grid .et2_taglist_thumbnail .et2_taglist_thumbnail_img {
/* Toggle single / multiple */ /* Toggle single / multiple */
.et2_taglist_toggle { .et2_taglist_toggle {
position: relative; position: relative;
overflow: visible !important;
} }
.et2_taglist_toggle > div.ms-ctn { .et2_taglist_toggle > div.ms-ctn {
display: inline-block; display: inline-block;
@ -1215,11 +1216,9 @@ div .et2_taglist_single:not(.et2_taglist_small) div.ms-sel-ctn div.ms-sel-item {
} }
.et2_taglist.et2_taglist_toggle div.ms-ctn input { .et2_taglist.et2_taglist_toggle div.ms-ctn input {
border:none; border:none;
background-color: #fafafa;
} }
.et2_taglist.et2_taglist_single .ms-ctn.form-control { .et2_taglist.et2_taglist_single .ms-ctn.form-control {
border-radius: 3px;
background-color: #fafafa;
} }
.et2_taglist_single.et2_taglist_category .ms-sel-item > span:first-child { .et2_taglist_single.et2_taglist_category .ms-sel-item > span:first-child {
padding: 0; padding: 0;
@ -1262,7 +1261,7 @@ div .et2_taglist_small.et2_taglist_single div.ms-sel-ctn div.ms-sel-item {
.et2_taglist_small.ui-state-hover, .et2_taglist_small.ui-state-hover,
.et2_taglist_small.ui-state-active { .et2_taglist_small.ui-state-active {
max-height: none; max-height: none;
min-width: 15em; min-width: 10em;
background: white; background: white;
z-index: 5; z-index: 5;
margin-top: 0px; margin-top: 0px;