This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

修复layer的confirm和prompt参数弄错的bug

old
宇天 2017-09-25 01:23:26 +08:00
parent 1cbaafe0c0
commit a597117368
1 changed files with 10 additions and 11 deletions

View File

@ -103,17 +103,19 @@ define(['yua', 'lib/drag/main', 'css!./skin/def'], function(yua){
conf.content = msg
return __layer.open(conf)
},
confirm: function(msg, conf){
if(typeof conf === 'function'){
conf = {yes: conf}
}else if(typeof conf === 'object'){
conf = conf
}else{
conf = {}
confirm: function(msg, yescb, nocb){
var conf = {}
if(typeof yescb === 'function'){
conf = {yes: yescb}
}else if(typeof yescb === 'object'){
conf = yescb
}
conf.type = 2
conf.icon = 0
conf.content = msg
if(typeof nocb === 'function'){
conf.no = nocb
}
return __layer.open(conf)
},
msg: function(msg, conf){
@ -181,7 +183,7 @@ define(['yua', 'lib/drag/main', 'css!./skin/def'], function(yua){
conf.menubar = false;
return __layer.open(conf)
},
prompt: function(msg, yescb, nocb){
prompt: function(msg, yescb){
if(typeof yescb !== 'function'){
return console.error('argument [callback] requires a function, but ' + (typeof yescb) + ' given')
}
@ -197,9 +199,6 @@ define(['yua', 'lib/drag/main', 'css!./skin/def'], function(yua){
yescb(id, yua.vmodels[id].prompt)
}
}
if(typeof nocb === 'function'){
conf.no = nocb
}
return __layer.open(conf)
},
use: function(skin, callback){