From d303763d1f7b532a69f2865c16a71e90bbf2fe5c Mon Sep 17 00:00:00 2001
From: Thomas Tanghus <thomas@tanghus.net>
Date: Mon, 13 Aug 2012 15:07:15 +0200
Subject: [PATCH] Automatically check radio when new addressbook fields get
 focus.

---
 apps/contacts/templates/part.selectaddressbook.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/apps/contacts/templates/part.selectaddressbook.php b/apps/contacts/templates/part.selectaddressbook.php
index c54ddaf2e6..812a3b891f 100644
--- a/apps/contacts/templates/part.selectaddressbook.php
+++ b/apps/contacts/templates/part.selectaddressbook.php
@@ -1,4 +1,11 @@
 <div id="selectaddressbook_dialog" title="<?php echo $l->t("Select Address Books"); ?>">
+<script type="text/javascript">
+$(document).ready(function() {
+	$('input.name,input.desc').on('focus', function(e) {
+		$('#book_new').prop('checked', true);
+	});
+});
+</script>
 <form>
 <table style="width: 100%">
 	<?php foreach($_['addressbooks'] as $idx => $addressbook) { ?>
-- 
GitLab