extranet/www/js/scripts.js

73 lines
2.0 KiB
JavaScript
Raw Normal View History

$(document).ready(function(){
2009-05-26 10:03:51 +00:00
//Autocomplete sur le champs NAF
$("#formR-naf").autocomplete("./pages/nafajax.php", {
minChars:3,
width: 400,
highlight: false,
scroll: true,
formatResult: function(data, value) {
return value.split(" , ")[0];
}
});
//Chargement du menu Accordion
$(function() {
$("#Menu").accordion({autoHeight: false, collapsible: true, active: 0});
});
//Auto Scroll
$(window).scroll(function() {
var offset = $(document).scrollTop();
$("#floatMenu").css('margin-top',offset);
});
//Boite de dialog surveillance
$('.dialogsurv').live('click', function(){
var title = $(this).attr('title');
var href = $(this).attr('href')+'&dialog=1';
var dialogOpts = {
bgiframe: true,
title: title,
width: 500,
height: 350,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {
'Ok': function() {
var buttons = $('#dialogsurv').dialog('option','buttons');
for( var button in buttons ){
$(":button:contains('"+button+"')").attr('disabled','disabled');
}
var href = $(location).attr('href');
2010-04-09 13:08:17 +00:00
var serData = $("#frmSurv").serialize();
$("#frmSurv").replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
2010-04-09 13:08:17 +00:00
$.post('./pages/ajax_surveillance.php', serData,
function(data) {
if(data==''){
$('#frmSurv').html("L'entité a été placé sous surveillance.\n");
$(location).attr('href', href);
}else{
$('#frmSurv').html(data);
}
});
},
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogsurv').remove(); }
};
$('<div id="dialogsurv"></div>').dialog(dialogOpts);
return false;
});
$('u[tooltip]').each(function(){
$(this).qtip({
content: $(this).attr('tooltip'),
style: { name: 'dark' },
position: {
corner: { target: 'topMiddle',
tooltip: 'bottomMiddle' } }
});
});
});