Skip to content

Commit 0c0b1e6

Browse files
committed
bump ver, update doc
1 parent a54b301 commit 0c0b1e6

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,37 @@ From your command prompt/termial go to your app's root folder and execute:
2020
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
2121
xmlns:SignaturePad="nativescript-signaturepad">
2222
<StackLayout>
23-
<SignaturePad:SignaturePad id="drawingPad" penColor="#3489db" penWidth="5" />
23+
<SignaturePad:SignaturePad
24+
height="200"
25+
id="drawingPad"
26+
penColor="#ff4081"
27+
penWidth="3" />
28+
29+
<button text="Get Drawing" tap="getDrawing" />
30+
<button text="Clear Drawing" tap="clearDrawing" />
2431
</StackLayout>
2532
</Page>
2633
```
2734

2835
#### JS:
2936
```JS
3037
var frame = require("ui/frame");
38+
39+
// To get the drawing...
3140
function getDrawing(args) {
3241
// get reference to the drawing pad
3342
var pad = frame.topmost().currentPage.getViewById("drawingPad");
3443
// then access the 'drawing' property (Bitmap on Android) of the signaturepad
3544
var drawingImage = pad.drawing;
45+
}
46+
exports.getDrawing = getDrawing;
3647

37-
// If you want to clear the signature/drawing...
48+
// If you want to clear the signature/drawing...
49+
function clearDrawing(args) {
50+
var pad = frame.topmost().currentPage.getViewById("drawingPad");
3851
pad.clearDrawing();
3952
}
40-
exports.getDrawing = getDrawing;
53+
exports.clearDrawing = clearDrawing;
4154
```
4255

4356
## Attributes

demo/app/main-page.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
class="message" textWrap="true" />
1313

1414
<SignaturePad:SignaturePad
15-
height="270"
15+
height="200"
1616
id="drawingPad"
1717
penColor="#ff4081"
1818
penWidth="3" />
1919

2020
<Button text="Get Drawing" tap="getDrawing" />
2121
<button text="Clear Drawing" tap="clearDrawing" />
22+
2223
</StackLayout>
2324
</ScrollView>
2425
</Page>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-signaturepad",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"main": "signaturepad.js",
55
"description": "A NativeScript plugin to provide a way to capture signatures (and any other drawing) from the device screen.",
66
"nativescript": {

0 commit comments

Comments
 (0)