Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12215 from fabi1cazenave/fdnOkButton-bug916061
Browse files Browse the repository at this point in the history
 Bug 916061 - [FDN] “OK” button should be disabled when adding a new contact, r=arthurcc
  • Loading branch information
fabi1cazenave committed Nov 8, 2013
2 parents 3553a6f + 0240104 commit 275ca2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/settings/elements/call_fdn_list_add.html
Expand Up @@ -6,7 +6,7 @@
<span data-l10n-id="back" class="icon icon-back">Back</span>
</a>
<menu type="toolbar">
<button id="fdnContact-submit"><span data-l10n-id="ok">Done</span></button>
<button id="fdnContact-submit"><span data-l10n-id="done">Done</span></button>
</menu>
<h1 id="fdnContact-title"></h1>
</header>
Expand Down
8 changes: 7 additions & 1 deletion apps/settings/js/simcard_fdn.js
Expand Up @@ -79,11 +79,17 @@ var SimFdnLock = {
}
}).bind(this));

var checkContactInputs = function() {
self.fdnContactSubmit.disabled = !self.fdnContactNumber.value;
};
this.fdnContactNumber.oninput = checkContactInputs;

this.fdnContactButton.onclick = function() { // add FDN contact
localize(self.fdnContactTitle, 'fdnAction-add');
self.fdnContactName.value = '';
self.fdnContactNumber.value = '';
self.fdnContactSubmit.onclick = self.addContact.bind(self);
checkContactInputs();
Settings.currentPanel = '#call-fdnList-add';
};

Expand All @@ -93,6 +99,7 @@ var SimFdnLock = {
self.fdnContactNumber.value = self.currentContact.number;
self.fdnContactSubmit.onclick = self.editContact.bind(self);
self.hideActionMenu();
checkContactInputs();
Settings.currentPanel = '#call-fdnList-add';
};

Expand Down Expand Up @@ -212,7 +219,6 @@ var SimFdnLock = {
wrongPinError: function(e) {
throw new Error('Incorrect PIN2 code.', e);
}

};

navigator.mozL10n.ready(SimFdnLock.init.bind(SimFdnLock));
Expand Down

0 comments on commit 275ca2c

Please sign in to comment.