From ae4904076ccddb769371ead23a222d9fd8399f95 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 26 Nov 2013 23:37:48 +0000 Subject: [PATCH] - Instanciate infolog JS object if available (for contact view) - Fix custom country JS --- addressbook/js/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addressbook/js/app.js b/addressbook/js/app.js index 2938a7adbc..f609cc299a 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -62,6 +62,12 @@ app.classes.addressbook = AppJS.extend( { this.show_custom_country($j('select[id*="adr_one_countrycode"]').get(0)); this.show_custom_country($j('select[id*="adr_two_countrycode"]').get(0)); + + // Instanciate infolog JS too - wrong app, so it won't be done automatically + if(typeof window.app.infolog != 'object' && typeof window.app.classes['infolog'] == 'function') + { + window.app.infolog = new window.app.classes.infolog(); + } } jQuery('select[id*="adr_one_countrycode"]').each(function() { @@ -234,7 +240,7 @@ app.classes.addressbook = AppJS.extend( show_custom_country: function(selectbox) { if(!selectbox) return; - var custom_field_name = selectbox.name.replace("countrycode", "countryname"); + var custom_field_name = selectbox.id.replace("countrycode", "countryname"); var custom_field = document.getElementById(custom_field_name); if(custom_field && selectbox.value == "-custom-") { custom_field.style.display = "inline";