















var _messager = $.extend({},$.messager);
$.extend($.messager,{
alert:function(title, msg, icon, fn){
var win = _messager.alert.call(this,title,msg,icon,fn); win.on('keyup',function(e){
if(e.which ==32){
win.window('close');
if (fn){
fn();
return false;
}
}
});
},
confirm: function(title,msg,fn){
var win = _messager.confirm.call(this,title,msg,fn);
win.on('keyup',function(e){
if(e.which ==32 || e.which ==13){
win.window('close');
if (fn){
fn(true);
return false;
}
}
if(e.which == 27) { // esc
win.window('close');
if(fn){
fn(false);return false;
}
}
});
},
prompt:function(title,msg,fn){
var win = _messager.prompt.call(this,title,msg,fn);
win.on('keyup',function(e){
if(e.which ==13){
win.window('close');
if (fn){
fn($('.messager-input', win).val());
return false;
}
}
if(e.which == 27) { // esc
win.window('close');
if(fn){
fn();return false;
}
}
});
}
});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。