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