Skip to content

Commit 64bf4c3

Browse files
committed
Added optional clear button
1 parent 496382e commit 64bf4c3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
/build
99

1010
.DS_Store
11+
npm-debug.log
1112
/node_modules/*

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import React from "react";
22
import SignaturePad from "./src/index";
33

44
React.render(
5-
<SignaturePad />,
5+
<SignaturePad clearButton="true" />,
66
document.body
77
)

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ export default class SignaturePad extends React.Component {
295295
<div className="m-signature-pad--body">
296296
<canvas ref="cv"></canvas>
297297
</div>
298+
{ this.props.clearButton &&
299+
<div className="m-signature-pad--footer">
300+
<button className="btn btn-default button clear" onClick={this.clear.bind(this)}>Clear</button>
301+
</div>
302+
}
298303
</div>
299304
);
300305
}

0 commit comments

Comments
 (0)