Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#7428 from albertopq/issue-827957
Browse files Browse the repository at this point in the history
Bug 827292 - Adding favorite diffrentation r=basiclines
  • Loading branch information
vingtetun committed Jan 10, 2013
2 parents 15e6c92 + f92cc8c commit 2b8b03b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
13 changes: 10 additions & 3 deletions apps/communications/contacts/js/contacts_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ contacts.Details = (function() {
}
}

// Disabling button while saving the contact
favoriteMessage.style.pointerEvents = 'none';

var request = navigator.mozContacts.save(contact);
request.onsuccess = function onsuccess() {
var cList = contacts.List;
Expand All @@ -207,19 +210,23 @@ contacts.Details = (function() {
cList.refresh(contact);
}
renderFavorite(contactData);
favoriteMessage.style.pointerEvents = 'auto';
}, function onError() {
console.error('Error reloading contact');
favoriteMessage.style.pointerEvents = 'auto';
});
};
request.onerror = function onerror() {
favoriteMessage.style.pointerEvents = 'auto';
console.error('Error saving favorite');
};
};

var toggleFavoriteMessage = function toggleFavMessage(isFav) {
favoriteMessage.textContent = !isFav ?
_('addFavorite') :
_('removeFavorite');
var cList = favoriteMessage.classList;
var text = isFav ? _('removeFavorite') : _('addFavorite');
favoriteMessage.textContent = text;
isFav ? cList.add('on') : cList.remove('on');
};

var renderOrg = function cd_renderOrg(contact) {
Expand Down
7 changes: 6 additions & 1 deletion apps/communications/contacts/style/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,12 @@ li button.icon-link:before {

/* Extending icons */
li button.icon-fav:before {
background-image: url(/contacts/style/images/icon-fav-button.png);
background-image: url(/contacts/style/images/icon-fav-button-off.png);
right: 0.5rem;
}

li button.icon-fav.on:before {
background-image: url(/contacts/style/images/icon-fav-button-on.png);
}

li button.icon-fb-profile:before {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 2b8b03b

Please sign in to comment.