cmc-sales/webroot/js/view_user.js

44 lines
726 B
JavaScript
Raw Normal View History

2011-03-15 23:51:43 -07:00
$(function() {
$('#hide').hide();
$('#enquiryTable').hide();
$("#ajaxLoad").hide();
$("#ajaxLoad").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxComplete", function() {
$(this).hide();
});
var userID = $('#userID').text();
var alreadyFetched = false;
$('#show').click(function() {
$(this).hide();
$('#hide').show();
if(alreadyFetched == false) {
2011-03-16 15:24:44 -07:00
2011-03-15 23:51:43 -07:00
alreadyFetched = true;
}
2011-03-16 15:24:44 -07:00
$.get('/enquiries/view_user_enquiries/'+userID, function(data) {
$('#enquiryTable').html(data);
});
2011-03-15 23:51:43 -07:00
$('#enquiryTable').slideDown('fast');
});
$('#hide').click(function() {
$(this).hide();
$('#show').show();
$('#enquiryTable').slideUp('fast');
});
});