添加一个配置 允许prompt为空

prompt框可能只是在某些操作时添加一个备注,添加一个选项允许没输入的时候提交
pull/63/head
xiaoze 2018-02-01 16:34:52 +08:00
parent 0018e1a54f
commit ab1639049c
1 changed files with 1 additions and 1 deletions

View File

@ -1003,7 +1003,7 @@ layer.prompt = function(options, yes){
,resize: false
,yes: function(index){
var value = prompt.val();
if(value === ''){
if(!options.allowNull && value === ''){
prompt.focus();
} else if(value.length > (options.maxlength||500)) {
layer.tips('最多输入'+ (options.maxlength || 500) +'个字数', prompt, {tips: 1});