Permalink
Browse files

Merge pull request #7428 from albertopq/issue-827957

Bug 827292 - Adding favorite diffrentation r=basiclines
  • Loading branch information...
2 parents 15e6c92 + f92cc8c commit 2b8b03b304b09f7972200cc5be9f0f0631d9a8cf @vingtetun vingtetun committed Jan 10, 2013
@@ -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;
@@ -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) {
@@ -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 {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered

0 comments on commit 2b8b03b

Please sign in to comment.