Improved view user email speed hopefully
This commit is contained in:
parent
89ba361b72
commit
c112c1011d
|
|
@ -9,6 +9,7 @@ class EmailsController extends AppController {
|
||||||
|
|
||||||
var $paginate = array(
|
var $paginate = array(
|
||||||
|
|
||||||
|
'fields'=> array('Email.id', 'Email.user_id', 'Email.subject','Email.udate','User.id','User.first_name','User.last_name','User.email'),
|
||||||
'contain' => false,
|
'contain' => false,
|
||||||
'limit' => 150,
|
'limit' => 150,
|
||||||
'order'=>array('Email.id' => 'desc')
|
'order'=>array('Email.id' => 'desc')
|
||||||
|
|
@ -114,6 +115,8 @@ class EmailsController extends AppController {
|
||||||
$userMail = $this->paginate('Email');
|
$userMail = $this->paginate('Email');
|
||||||
//$userMail = $this->Email->find('all', array('conditions'=>array('Email.id'=>$allIDs), 'order'=>array('Email.udate DESC')));
|
//$userMail = $this->Email->find('all', array('conditions'=>array('Email.id'=>$allIDs), 'order'=>array('Email.udate DESC')));
|
||||||
$this->set('userMail', $userMail);
|
$this->set('userMail', $userMail);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ User Email<?php echo $html->image('internet-mail.png'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<? //debug($userMail); ?>
|
<? debug($userMail); ?>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
<div id="ajaxLoadEmail" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
|
<div id="ajaxLoadEmail" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
|
||||||
|
|
||||||
<div id="emailTable">
|
|
||||||
|
|
||||||
|
<div id="emailTable">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ $(function() {
|
||||||
|
|
||||||
|
|
||||||
$(".pagingEmail").find('a').click(function() {
|
$(".pagingEmail").find('a').click(function() {
|
||||||
|
alert("BOO");
|
||||||
$('#emailTable').fadeOut('slow');
|
$('#emailTable').fadeOut('slow');
|
||||||
|
|
||||||
$("#ajaxLoadEmail").bind("ajaxSend", function() {
|
$("#ajaxLoadEmail").bind("ajaxSend", function() {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,7 @@ $(function() {
|
||||||
$('#enquiryTable').hide();
|
$('#enquiryTable').hide();
|
||||||
|
|
||||||
$("#ajaxLoadEnquiry").hide();
|
$("#ajaxLoadEnquiry").hide();
|
||||||
$("#ajaxLoadEnquiry").bind("ajaxSend", function() {
|
|
||||||
$(this).show();
|
|
||||||
}).bind("ajaxComplete", function() {
|
|
||||||
$(this).hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,7 +28,10 @@ $(function() {
|
||||||
$('#show').click(function() {
|
$('#show').click(function() {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$('#hide').show();
|
$('#hide').show();
|
||||||
$('#enquiryTable').slideDown('fast');
|
$("#ajaxLoadEnquiry").show();
|
||||||
|
$('#enquiryTable').slideDown('fast', function() {
|
||||||
|
$("#ajaxLoadEnquiry").hide();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,9 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$('#hideEmail').hide();
|
$('#hideEmail').hide();
|
||||||
|
|
||||||
$('#emailTable').hide();
|
$('#emailTable').hide();
|
||||||
|
|
||||||
$("#ajaxLoadEmail").hide();
|
|
||||||
$("#ajaxLoadEmail").bind("ajaxSend", function() {
|
|
||||||
$(this).show();
|
|
||||||
}).bind("ajaxComplete", function() {
|
|
||||||
$(this).hide();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var userID = $('#userID').text();
|
var userID = $('#userID').text();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -21,18 +12,21 @@ $(function() {
|
||||||
$('#hideEmail').click(function() {
|
$('#hideEmail').click(function() {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$('#showEmail').show();
|
$('#showEmail').show();
|
||||||
|
|
||||||
$('#emailTable').slideUp('fast');
|
$('#emailTable').slideUp('fast');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#showEmail').click(function() {
|
$('#showEmail').click(function() {
|
||||||
$(this).hide();
|
|
||||||
$('#hideEmail').show();
|
$('#showEmail').hide();
|
||||||
|
$("#ajaxLoadEmail").show();
|
||||||
|
|
||||||
$.get('/emails/view_user_emails/'+userID, function(data) {
|
$.get('/emails/view_user_emails/'+userID, function(data) {
|
||||||
$('#emailTable').html(data);
|
$('#emailTable').html(data);
|
||||||
$('#emailTable').slideDown('fast');
|
$('#emailTable').slideDown('fast', function() {
|
||||||
|
$('#ajaxLoadEmail').hide();
|
||||||
|
});
|
||||||
|
$('#hideEmail').show();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue