cmc-sales/webroot/js/email_table.js

55 lines
824 B
JavaScript
Raw Normal View History

2010-03-22 19:27:53 -07:00
/**
* file: email_table.js
* date: Tue 23 March 2010
* author: Karl Cordes
*
* purpose: uses jQuery to create a mail client-like interface for viewing the emails associated with an enquiry (or contact)
*
*/
$(function () {
$("#ViewDialog").dialog({
2011-03-09 23:18:26 -08:00
autoOpen: false,
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
width: 900,
modal: false,
2011-03-10 19:09:38 -08:00
position: 'top',
2011-03-09 23:18:26 -08:00
buttons: {
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
Close: function() {
$(this).dialog('close');
}
},
close: function() {
//What happens on close goes here.
}
2010-03-22 19:27:53 -07:00
});
$('.viewLink').click(function() {
2011-03-09 23:18:26 -08:00
var currentID = $(this).attr('id');
var subject = $(this).text();
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
$("#ViewDialog").dialog("option", "title", subject);
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
$.get('/emails/frame/'+currentID, function (data) {
$("#ViewDialog").html(data);
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
});
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
$("#ViewDialog").dialog('open');
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
return false;
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
});
2010-03-22 19:27:53 -07:00
2011-03-09 23:18:26 -08:00
2010-03-22 19:27:53 -07:00
}
);