Skip to content
Browse files

Letting ContactDetails handle the "tap outside to close"

  • Loading branch information...
1 parent 0ca400a commit a74a18862331281eacda02ce91b33937d297901a @etiennesegonzac etiennesegonzac committed Mar 4, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 apps/dialer/js/contacts.js
View
16 apps/dialer/js/contacts.js
@@ -229,6 +229,14 @@ var ContactDetails = {
_editing: false,
setup: function cd_setup() {
window.addEventListener('keyup', this, true);
+
+ // click outside details container to close
+ this.overlay.addEventListener('click', function(evt) {
+ ContactDetails.hide();
+ });
+ this.container.addEventListener('click', function(evt) {
+ evt.stopPropagation();
+ });
},
get overlay() {
delete this.overlay;
@@ -473,14 +481,6 @@ window.addEventListener('load', function contactSetup(evt) {
ShortcutsHandler.setup();
ContactDetails.setup();
- // click outside details container to close
- document.getElementById('contacts-overlay').addEventListener('click', function(evt) {
- ContactDetails.hide();
- });
- document.getElementById('contact-details-container').addEventListener('click', function(evt) {
- evt.stopPropagation();
- });
-
// add scrollwheel fallback for browser users
var scrollNode = Contacts.view;
scrollNode.addEventListener('DOMMouseScroll', wheel, false);

0 comments on commit a74a188

Please sign in to comment.
Something went wrong with that request. Please try again.