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,25 +1,22 @@
(function(){ (function() {
$(document).ready(function() {
$(document).ready(function(){ humane.info = humane.spawn({addnCls: 'humane-libnotify-info', timeout: 1000});
humane.error = humane.spawn({addnCls: 'humane-libnotify-error', timeout: 1000});
$('a.dialog').live('click', function(event){
$('a.dialog').live('click', function(event) {
var $this = $(this), size = 'Medium'; var $this = $(this), size = 'Medium';
if($this.hasClass('small-dialog')) if ($this.hasClass('small-dialog')) {
{
size = 'Small'; size = 'Small';
} } else if ($this.hasClass('full-dialog')) {
else if($this.hasClass('full-dialog'))
{
size = 'Full'; size = 'Full';
} }
var options = { var options = {
size : size, size: size,
loading : true, loading: true,
title : $this.attr('title'), title: $this.attr('title'),
closeOnEscape : true closeOnEscape: true
}; };
$dialog = p4.Dialog.Create(options); $dialog = p4.Dialog.Create(options);
@@ -28,10 +25,7 @@
type: "GET", type: "GET",
url: $this.attr('href'), url: $this.attr('href'),
dataType: 'html', dataType: 'html',
beforeSend:function(){ success: function(data) {
},
success: function(data){
$dialog.setContent(data); $dialog.setContent(data);
return; return;
} }
@@ -39,7 +33,5 @@
return false; return false;
}); });
}); });
}());
}())