Browse Source

native receive dropdown outside click

all-modes
pbca26 8 years ago
parent
commit
a19f32b03c
  1. 2
      react/src/components/dashboard/walletsData.js
  2. 18
      react/src/components/dashboard/walletsNativeReceive.js
  3. 2
      react/src/components/dashboard/walletsNativeSyncProgress.js
  4. 3
      react/src/components/dashboard/walletsNativeTxHistory.js

2
react/src/components/dashboard/walletsData.js

@ -70,8 +70,6 @@ class WalletsData extends React.Component {
}
handleClickOutside(e) {
console.log(e);
if (e.srcElement.className !== 'btn dropdown-toggle btn-info' &&
(e.srcElement.offsetParent && e.srcElement.offsetParent.className !== 'btn dropdown-toggle btn-info') &&
(e.path && e.path[4] && e.path[4].className.indexOf('showkmdwalletaddrs') === -1) &&

18
react/src/components/dashboard/walletsNativeReceive.js

@ -16,6 +16,24 @@ class WalletsNativeReceive extends React.Component {
openDropMenu: false,
};
this.openDropMenu = this.openDropMenu.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
}
componentWillMount() {
document.addEventListener('click', this.handleClickOutside, false);
}
componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, false);
}
handleClickOutside(e) {
if (e.srcElement.className.indexOf('dropdown') === -1 &&
(e.srcElement.offsetParent && e.srcElement.offsetParent.className.indexOf('dropdown') === -1)) {
this.setState({
openDropMenu: false,
});
}
}
openDropMenu() {

2
react/src/components/dashboard/walletsNativeSyncProgress.js

@ -29,7 +29,7 @@ class WalletsNativeSyncProgress extends React.Component {
</div>
);
} else {
var syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0);
const syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0);
return (
<div

3
react/src/components/dashboard/walletsNativeTxHistory.js

@ -26,7 +26,8 @@ class WalletsNativeTxHistory extends React.Component {
}
isFullySynced() {
if (this.props.Dashboard.progress &&
if (this.props.Dashboard &&
this.props.Dashboard.progress &&
this.props.Dashboard.progress.balances &&
(Number(this.props.Dashboard.progress.balances) +
Number(this.props.Dashboard.progress.validated) +

Loading…
Cancel
Save