Skip to content
Browse files

Merge pull request #7426 from basiclines/contacts_switches_improves

Bug 817927 - [Contacts] Even if Facebook is disabled, you can still clic...
  • Loading branch information...
2 parents eb3b9aa + b2ee8d3 commit 7d6e82223cb60d27232cd2b6b19c99b8c0db3580 @jmcanterafonseca jmcanterafonseca committed Jan 10, 2013
View
12 apps/communications/contacts/js/contacts_settings.js
@@ -8,7 +8,7 @@ var contacts = window.contacts || {};
**/
contacts.Settings = (function() {
- var orderCheckbox,
+ var orderItem,
orderByLastName,
simImportLink,
fbImportOption,
@@ -42,7 +42,7 @@ contacts.Settings = (function() {
var updateOrderingUI = function updateOrderingUI() {
var value = newOrderByLastName === null ? orderByLastName :
newOrderByLastName;
- orderCheckbox.checked = value;
+ orderItem.checked = value;
};
var cleanMessage = function cleanMessage() {
@@ -54,8 +54,8 @@ contacts.Settings = (function() {
// Initialises variables and listener for the UI
var initContainers = function initContainers() {
- orderCheckbox = document.querySelector('[name="order.lastname"]');
- orderCheckbox.addEventListener('change', onOrderingChange.bind(this));
+ orderItem = document.getElementById('settingsOrder');
+ orderItem.addEventListener('click', onOrderingChange.bind(this));
simImportLink = document.querySelector('[data-l10n-id="importSim"]');
simImportLink.addEventListener('click',
@@ -327,7 +327,9 @@ contacts.Settings = (function() {
// Listens for any change in the ordering preferences
var onOrderingChange = function onOrderingChange(evt) {
- newOrderByLastName = evt.target.checked;
+ var checkBox = evt.target.querySelector('[name="order.lastname"]');
+ checkBox.checked = !checkBox.checked;
+ newOrderByLastName = checkBox.checked;
asyncStorage.setItem(ORDER_KEY, newOrderByLastName);
updateOrderingUI();
};
View
30 apps/communications/contacts/style/contacts.css
@@ -215,6 +215,12 @@ hr {
}
/* Overriding Input areas BB */
+form p input + button[type="reset"].hide,
+form p textarea + button[type="reset"].hide {
+ display: block!important;
+ opacity: 0;
+ pointer-events: none;
+}
fieldset legend.action {
padding-right: 1.8rem;
@@ -336,6 +342,11 @@ section[role="region"] > header .icon.icon-settings
padding: 0;
}
+/* Order switch */
+#view-settings [data-type="list"] li#settingsOrder aside {
+ pointer-events: none;
+}
+
/* Cutom FB item */
#view-settings [data-type="list"] .fb-item {
height: auto;
@@ -356,15 +367,30 @@ section[role="region"] > header .icon.icon-settings
}
#view-settings [data-type="list"] .fb-item aside {
- position: static;
width: 6.5rem;
+ height: 6rem;
+ pointer-events: none;
}
#view-settings [data-type="list"] .fb-item aside label {
position: absolute;
right: 0;
}
+#view-settings [data-type="list"] .fb-item[aria-disabled="true"] {
+ pointer-events: none;
+}
+
+#view-settings [data-type="list"] .fb-item[aria-disabled="true"]:after {
+ display: none;
+}
+
+#view-settings [data-type="list"] .fb-item[aria-disabled="true"] aside {
+ opacity: 0.3;
+}
+
+
+
/* Extending BB lists components*/
#view-settings [data-type="list"] li aside {
pointer-events: auto;
@@ -392,6 +418,7 @@ section[role="region"] > header .icon.icon-settings
/* Extending icon types*/
#view-settings [data-type="list"] li button.icon-sim:before {
background-image: url(/contacts/style/images/import_SIM.png);
+ background-size: 1.6rem;
}
@@ -478,3 +505,4 @@ section[role="region"] > header .icon.icon-settings
left: -100%;
opacity: 0;
}
+

0 comments on commit 7d6e822

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