Permalink
Browse files

Merge pull request #7295 from jmcanterafonseca/fix_activity_layout

Bug 808618. Pick Contact Activity cross icon in header
  • Loading branch information...
2 parents 8d16d6e + b870050 commit d1f25c7750963e283d40ea61708590c5bbdf37be @jmcanterafonseca jmcanterafonseca committed Jan 7, 2013
@@ -89,8 +89,10 @@
<!-- Contacts List Section -->
<section id='view-contacts-list' role="region" data-state="active" class="view view-noscroll view-contacts-list">
<header>
+ <a href="#" id="cancel_activity" class="hide">
+ <span class="icon icon-close" data-l10n-id="exit">Exit</span>
+ </a>
<menu type="toolbar">
- <button role="menuitem" id="cancel_activty" class="hide"><span class="icon icon-close"data-l10n-id="exit">Exit</span></button>
<button role="menuitem" id="add-contact-button"><span class="icon icon-add" data-l10n-id="add">add</span></button>
<button role="menuitem" id="settings-button"><span class="icon icon-settings" data-l10n-id="settings">settings</span></button>
</menu>
@@ -21,7 +21,10 @@ var Contacts = (function() {
saveButton,
editContactButton,
settings,
- settingsButton;
+ settingsButton,
+ cancelButton,
+ addButton,
+ appTitleElement;
var readyToPaint = false;
var firstContacts = null;
@@ -145,6 +148,9 @@ var Contacts = (function() {
customTag = document.getElementById('custom-tag');
settings = document.getElementById('view-settings');
settingsButton = document.getElementById('settings-button');
+ cancelButton = document.getElementById('cancel_activity');
+ addButton = document.getElementById('add-contact-button');
+ appTitleElement = cancelButton.parentNode.querySelector('h1');
TAG_OPTIONS = {
'phone-type' : [
@@ -188,16 +194,16 @@ var Contacts = (function() {
};
var checkCancelableActivity = function cancelableActivity() {
- var cancelButton = document.getElementById('cancel_activty');
- var addButton = document.getElementById('add-contact-button');
if (ActivityHandler.currentlyHandling) {
cancelButton.classList.remove('hide');
addButton.classList.add('hide');
settingsButton.classList.add('hide');
+ appTitleElement.textContent = _('selectContact');
} else {
cancelButton.classList.add('hide');
addButton.classList.remove('hide');
settingsButton.classList.remove('hide');
+ appTitleElement.textContent = _('contacts');
}
};
@@ -586,7 +592,7 @@ var Contacts = (function() {
var initEventListeners = function initEventListener() {
// Definition of elements and handlers
utils.listeners.add({
- '#cancel_activty': handleCancel, // Activity (any) cancellation
+ '#cancel_activity': handleCancel, // Activity (any) cancellation
'#cancel-edit': handleCancel, // Cancel edition
'#save-button': contacts.Form.saveContact,
'#add-contact-button': showAddContact,
@@ -11,6 +11,7 @@ update = Update
contacts = Contacts
addContact = Add contact
deleteContact = Delete contact
+selectContact = Select contact
editContact = Edit contact
deleteConfirmMsg = Delete contact?
remove = Remove

0 comments on commit d1f25c7

Please sign in to comment.