toast is a UI that can be used as an alternative means of window.alert, window.confirm and window.prompt
How to initialize the properties of the UI, there are two.
You can pass the property values of the UI to setConfig
.
Using the new
you can pass when you initialize the UI.
setConfig([options, callInit=true])
var myToast = new ax5.ui.toast();
myToast.set_config({
msg: "String",
theme: "String",
width: "Number",
icon: "String",
closeIcon: "String",
onStateChanged: "Function",
displayTime: "Number",
animateTime: "Number",
containerPosition: "String",
lang: "Object"
});
Easy Way - without setConfig
var myToast = new ax5.ui.toast({
msg: "String",
theme: "String",
width: "Number",
icon: "String",
closeIcon: "String",
onStateChanged: "Function",
displayTime: "Number",
animateTime: "Number",
containerPosition: "String",
lang: "Object"
});
Type: String
Title of toast.
Type: String
[default: default]
Theme of toast, ax5toast themes using six colors defined by the bootstrap is provided.
Type: Number
[default: 300]
Toast width
Type: String
Type: String
Type: Function
onStateChanged function is executed when the toast of the state is changed, this.state state value is passed to this time onStateChanged function.
Type: Number
[default : 3000]
Type: Number
[default : 300]
Type: String
[top-left|top-right|bottom-left|bottom-right]
Type: Object
myToast.setConfig({
lang: {
"ok": "확인"
}
});
push(String|Options[, callback])
If this is String in the first argument and recognizes the first argument to msg
.
it is possible to redefine all of the options that can be used in setConfig.
toast.push('Toast message', function () {
console.log(this);
});
toast.push({
theme: 'danger',
msg:'Toast message'
}, function () {
console.log(this);
});
confirm(String|Options[, callback])
confirmToast.confirm({
msg: 'Confirm message'
}, function(){
});
close()