Set humanejs info & error function

This commit is contained in:
Nicolas Le Goff
2013-06-14 11:45:01 +02:00
parent a846a81ec2
commit 8a8868798b

View File

@@ -1,45 +1,37 @@
(function(){ (function() {
$(document).ready(function() {
humane.info = humane.spawn({addnCls: 'humane-libnotify-info', timeout: 1000});
humane.error = humane.spawn({addnCls: 'humane-libnotify-error', timeout: 1000});
$(document).ready(function(){ $('a.dialog').live('click', function(event) {
var $this = $(this), size = 'Medium';
$('a.dialog').live('click', function(event){ if ($this.hasClass('small-dialog')) {
size = 'Small';
} else if ($this.hasClass('full-dialog')) {
size = 'Full';
}
var $this = $(this), size = 'Medium'; var options = {
size: size,
loading: true,
title: $this.attr('title'),
closeOnEscape: true
};
if($this.hasClass('small-dialog')) $dialog = p4.Dialog.Create(options);
{
size = 'Small';
}
else if($this.hasClass('full-dialog'))
{
size = 'Full';
}
var options = { $.ajax({
size : size, type: "GET",
loading : true, url: $this.attr('href'),
title : $this.attr('title'), dataType: 'html',
closeOnEscape : true success: function(data) {
}; $dialog.setContent(data);
return;
}
});
$dialog = p4.Dialog.Create(options); return false;
});
$.ajax({
type: "GET",
url: $this.attr('href'),
dataType: 'html',
beforeSend:function(){
},
success: function(data){
$dialog.setContent(data);
return;
}
});
return false;
}); });
}());
});
}())