Skip to content

Commit

Permalink
Implement customizable positions (top/bottom) for every component.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredreich committed Mar 5, 2017
1 parent fa5f508 commit 9d3d202
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 88 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,32 @@ notie.alert({
type: Number|String, // optional, default = 4, enum: [1, 2, 3, 4, 5, 'success', 'warning', 'error', 'info', 'neutral']
text: String,
stay: Boolean, // optional, default = false
time: Number // optional, default = 3, minimum = 1
time: Number, // optional, default = 3, minimum = 1,
position: String // optional, default = 'top', enum: ['top', 'bottom']
})

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

notie.confirm({
text: String,
submitText: String, // optional, default = 'Yes'
cancelText: String, // optional, default = 'Cancel'
position: String, // optional, default = 'top', enum: ['top', 'bottom']
submitCallback: Function, // optional
cancelCallback: Function // optional
}, submitCallbackOptional(), cancelCallbackOptional())

notie.input({
text: String,
submitText: String, // optional, default = 'Submit'
cancelText: String // optional, default = 'Cancel'
cancelText: String, // optional, default = 'Cancel'
position: String, // optional, default = 'top', enum: ['top', 'bottom']
submitCallback: Function(value), // optional
cancelCallback: Function(value), // optional
autocapitalize: 'words', // default: 'none'
Expand All @@ -122,21 +126,23 @@ notie.input({
notie.select({
text: String,
cancelText: String, // optional, default = 'Cancel'
cancelCallback: Function, // optional
position: String, // optional, default = 'bottom', enum: ['top', 'bottom']
choices: [
{
type: Number|String, // optional, default = 1
text: String,
handler: Function
}
...
]
],
cancelCallback: Function // optional
}, cancelCallbackOptional())

notie.date({
value: Date,
submitText: String, // optional, default = 'OK'
cancelText: String, // optional, default = 'Cancel'
position: String, // optional, default = 'top', enum: ['top', 'bottom']
submitCallback: Function(date), // optional
cancelCallback: Function(date) // optional
}, submitCallbackOptional(date), cancelCallbackOptional(date))
Expand All @@ -149,7 +155,7 @@ notie.alert({ type: 1, text: 'Success!', stay: true }) // Never hides unless cli
notie.alert({ type: 'success', text: 'Success!', time: 2 }) // Hides after 2 seconds
notie.alert({ type: 2, text: 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>' })
notie.alert({ type: 'warning', text: 'Watch it...' })
notie.alert({ type: 3, text: 'Error.' })
notie.alert({ type: 3, text: 'Error.', position: 'bottom' })
notie.alert({ type: 'error', text: 'Oops!' })
notie.alert({ type: 4, text: 'Information.' })
notie.alert({ type: 'info', text: 'FYI, blah blah blah.' })
Expand Down Expand Up @@ -334,6 +340,14 @@ notie.setOptions({
},
ids: {
overlay: 'notie-overlay'
},
positions: {
alert: 'top',
force: 'top',
confirm: 'top',
input: 'top',
select: 'bottom',
date: 'top'
}
})
```
Expand Down
Loading

0 comments on commit 9d3d202

Please sign in to comment.