Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
/ notie Public archive

Commit 9d3d202

Browse files
committed
Implement customizable positions (top/bottom) for every component.
1 parent fa5f508 commit 9d3d202

File tree

5 files changed

+142
-88
lines changed

5 files changed

+142
-88
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,28 +79,32 @@ notie.alert({
7979
type: Number|String, // optional, default = 4, enum: [1, 2, 3, 4, 5, 'success', 'warning', 'error', 'info', 'neutral']
8080
text: String,
8181
stay: Boolean, // optional, default = false
82-
time: Number // optional, default = 3, minimum = 1
82+
time: Number, // optional, default = 3, minimum = 1,
83+
position: String // optional, default = 'top', enum: ['top', 'bottom']
8384
})
8485

8586
notie.force({
8687
type: Number|String, // optional, default = 5, enum: [1, 2, 3, 4, 5, 'success', 'warning', 'error', 'info', 'neutral']
8788
text: String,
8889
buttonText: String, // optional, default = 'OK'
90+
position: String, // optional, default = 'top', enum: ['top', 'bottom']
8991
callback: Function // optional
9092
}, callbackOptional())
9193

9294
notie.confirm({
9395
text: String,
9496
submitText: String, // optional, default = 'Yes'
9597
cancelText: String, // optional, default = 'Cancel'
98+
position: String, // optional, default = 'top', enum: ['top', 'bottom']
9699
submitCallback: Function, // optional
97100
cancelCallback: Function // optional
98101
}, submitCallbackOptional(), cancelCallbackOptional())
99102

100103
notie.input({
101104
text: String,
102105
submitText: String, // optional, default = 'Submit'
103-
cancelText: String // optional, default = 'Cancel'
106+
cancelText: String, // optional, default = 'Cancel'
107+
position: String, // optional, default = 'top', enum: ['top', 'bottom']
104108
submitCallback: Function(value), // optional
105109
cancelCallback: Function(value), // optional
106110
autocapitalize: 'words', // default: 'none'
@@ -122,21 +126,23 @@ notie.input({
122126
notie.select({
123127
text: String,
124128
cancelText: String, // optional, default = 'Cancel'
125-
cancelCallback: Function, // optional
129+
position: String, // optional, default = 'bottom', enum: ['top', 'bottom']
126130
choices: [
127131
{
128132
type: Number|String, // optional, default = 1
129133
text: String,
130134
handler: Function
131135
}
132136
...
133-
]
137+
],
138+
cancelCallback: Function // optional
134139
}, cancelCallbackOptional())
135140

136141
notie.date({
137142
value: Date,
138143
submitText: String, // optional, default = 'OK'
139144
cancelText: String, // optional, default = 'Cancel'
145+
position: String, // optional, default = 'top', enum: ['top', 'bottom']
140146
submitCallback: Function(date), // optional
141147
cancelCallback: Function(date) // optional
142148
}, submitCallbackOptional(date), cancelCallbackOptional(date))
@@ -149,7 +155,7 @@ notie.alert({ type: 1, text: 'Success!', stay: true }) // Never hides unless cli
149155
notie.alert({ type: 'success', text: 'Success!', time: 2 }) // Hides after 2 seconds
150156
notie.alert({ type: 2, text: 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>' })
151157
notie.alert({ type: 'warning', text: 'Watch it...' })
152-
notie.alert({ type: 3, text: 'Error.' })
158+
notie.alert({ type: 3, text: 'Error.', position: 'bottom' })
153159
notie.alert({ type: 'error', text: 'Oops!' })
154160
notie.alert({ type: 4, text: 'Information.' })
155161
notie.alert({ type: 'info', text: 'FYI, blah blah blah.' })
@@ -334,6 +340,14 @@ notie.setOptions({
334340
},
335341
ids: {
336342
overlay: 'notie-overlay'
343+
},
344+
positions: {
345+
alert: 'top',
346+
force: 'top',
347+
confirm: 'top',
348+
input: 'top',
349+
select: 'bottom',
350+
date: 'top'
337351
}
338352
})
339353
```

0 commit comments

Comments
 (0)