mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 17:43:44 +00:00
Bug 1069816: Enable import button in the contacts list. r=abr
This commit is contained in:
parent
0b4d324d7e
commit
392056106c
@ -209,7 +209,8 @@ loop.contacts = (function(_, mozL10n) {
|
||||
const ContactsList = React.createClass({displayName: 'ContactsList',
|
||||
getInitialState: function() {
|
||||
return {
|
||||
contacts: {}
|
||||
contacts: {},
|
||||
importBusy: false
|
||||
};
|
||||
},
|
||||
|
||||
@ -272,6 +273,16 @@ loop.contacts = (function(_, mozL10n) {
|
||||
},
|
||||
|
||||
handleImportButtonClick: function() {
|
||||
this.setState({ importBusy: true });
|
||||
navigator.mozLoop.startImport({
|
||||
service: "google"
|
||||
}, (err, stats) => {
|
||||
this.setState({ importBusy: false });
|
||||
// TODO: bug 1076764 - proper error and success reporting.
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleAddContactButtonClick: function() {
|
||||
@ -319,12 +330,15 @@ loop.contacts = (function(_, mozL10n) {
|
||||
return contact.blocked ? "blocked" : "available";
|
||||
});
|
||||
|
||||
// TODO: bug 1076767 - add a spinner whilst importing contacts.
|
||||
return (
|
||||
React.DOM.div(null,
|
||||
React.DOM.div({className: "content-area"},
|
||||
ButtonGroup(null,
|
||||
Button({caption: mozL10n.get("import_contacts_button"),
|
||||
disabled: true,
|
||||
Button({caption: this.state.importBusy
|
||||
? mozL10n.get("importing_contacts_progress_button")
|
||||
: mozL10n.get("import_contacts_button"),
|
||||
disabled: this.state.importBusy,
|
||||
onClick: this.handleImportButtonClick}),
|
||||
Button({caption: mozL10n.get("new_contact_button"),
|
||||
onClick: this.handleAddContactButtonClick})
|
||||
|
@ -209,7 +209,8 @@ loop.contacts = (function(_, mozL10n) {
|
||||
const ContactsList = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {
|
||||
contacts: {}
|
||||
contacts: {},
|
||||
importBusy: false
|
||||
};
|
||||
},
|
||||
|
||||
@ -272,6 +273,16 @@ loop.contacts = (function(_, mozL10n) {
|
||||
},
|
||||
|
||||
handleImportButtonClick: function() {
|
||||
this.setState({ importBusy: true });
|
||||
navigator.mozLoop.startImport({
|
||||
service: "google"
|
||||
}, (err, stats) => {
|
||||
this.setState({ importBusy: false });
|
||||
// TODO: bug 1076764 - proper error and success reporting.
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleAddContactButtonClick: function() {
|
||||
@ -319,12 +330,15 @@ loop.contacts = (function(_, mozL10n) {
|
||||
return contact.blocked ? "blocked" : "available";
|
||||
});
|
||||
|
||||
// TODO: bug 1076767 - add a spinner whilst importing contacts.
|
||||
return (
|
||||
<div>
|
||||
<div className="content-area">
|
||||
<ButtonGroup>
|
||||
<Button caption={mozL10n.get("import_contacts_button")}
|
||||
disabled
|
||||
<Button caption={this.state.importBusy
|
||||
? mozL10n.get("importing_contacts_progress_button")
|
||||
: mozL10n.get("import_contacts_button")}
|
||||
disabled={this.state.importBusy}
|
||||
onClick={this.handleImportButtonClick} />
|
||||
<Button caption={mozL10n.get("new_contact_button")}
|
||||
onClick={this.handleAddContactButtonClick} />
|
||||
|
Loading…
Reference in New Issue
Block a user