[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2502] trunk/UI/Contact



Revision: 2502
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2502&view=rev
Author:   einhverfr
Date:     2009-03-16 16:54:15 +0000 (Mon, 16 Mar 2009)

Log Message:
-----------
Hiding divs now occurs automatically when js is enabled

Modified Paths:
--------------
    trunk/UI/Contact/contact.html
    trunk/UI/Contact/contact.js

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2009-03-15 00:34:39 UTC (rev 2501)
+++ trunk/UI/Contact/contact.html	2009-03-16 16:54:15 UTC (rev 2502)
@@ -8,7 +8,33 @@
 	]
 ?>
 <?lsmb PROCESS 'elements.html' ?>
-<body onload="init()">
+<?lsmb IF (!entity_id and account_class != 3); 
+	target_div = 'company_div';
+ELSIF (!entity_id and account_class == 3) or action == 'save_employee';
+		target_div = 'hr_div';
+ELSIF action == 'save_credit' or action == 'get' or action == 'save_credit_new'
+			or action=='save'; 
+		target_div = 'credit_div';
+ELSIF action== 'save_location' or action == 'get_location' 
+			or action == 'delete_location';
+		target_div = 'location_div';
+ELSIF action== 'save_location' or action == 'get_location' 
+			or action == 'delete_location';
+		target_div = 'location_div';
+ELSIF action== 'save_contact' or action == 'get_contact' 
+			or action == 'delete_contact';
+		target_div = 'contact_div';
+ELSIF action== 'save_bank_account' or action == 'get_bank_acct' 
+			or action == 'delete_bank_acct';
+		target_div = 'bank_div';
+ELSIF action== 'save_notes';
+		target_div = 'notes_div';
+ELSE;
+	target_div = '';
+END ?>
+<body onload="init('<?lsmb target_div ?>')">
+<body onload="init('<?lsmb target_div ?>')">
+<body onload="init('<?lsmb target_div ?>')">
     <?lsmb IF name ?> 
     <div class="pageheading"><?lsmb name?></div>
     <?lsmb END ?>

Modified: trunk/UI/Contact/contact.js
===================================================================
--- trunk/UI/Contact/contact.js	2009-03-15 00:34:39 UTC (rev 2501)
+++ trunk/UI/Contact/contact.js	2009-03-16 16:54:15 UTC (rev 2502)
@@ -1,5 +1,5 @@
 
-function init() {
+function init(div_id) {
 	var lis = document.getElementsByTagName('li');
 	for (var e in lis){
 		if (e != e * 1){
@@ -22,6 +22,9 @@
 			},false);
 		}
 	}
+	if (div_id != ''){
+		select_div(div_id);
+	}
 }
 
 function select_div(div_id){


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.