2010-05-03 23:49:57 -07:00
|
|
|
|
|
|
|
|
$(function() {
|
2011-06-27 23:56:13 -07:00
|
|
|
|
|
|
|
|
var statusNamesJSON = $("#statusJSONlist").html();
|
|
|
|
|
|
|
|
|
|
var statusNames = $.parseJSON(statusNamesJSON);
|
|
|
|
|
|
|
|
|
|
var classNamesJSON = $("#statusClassNames").html();
|
|
|
|
|
|
|
|
|
|
var classNames = $.parseJSON(classNamesJSON);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.status').editable('/enquiries/update_status', {
|
|
|
|
|
id : 'data[Enquiry][id]',
|
|
|
|
|
name: 'data[Enquiry][status_id]',
|
|
|
|
|
|
|
|
|
|
data : $("#statusJSONlist").html(),
|
|
|
|
|
type : 'select',
|
|
|
|
|
indicator : 'Saving...',
|
|
|
|
|
submit : 'Update Status',
|
|
|
|
|
cssclass: 'MER-inplace-select',
|
|
|
|
|
callback : function(value, settings) {
|
|
|
|
|
var thisStatusID = value;
|
|
|
|
|
|
|
|
|
|
var newName = statusNames[thisStatusID];
|
|
|
|
|
|
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
|
$(this).html(newName);
|
|
|
|
|
|
|
|
|
|
var newClass = classNames[thisStatusID];
|
|
|
|
|
|
|
|
|
|
$("#row"+id).removeClass().addClass(newClass);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2013-07-15 03:27:28 -07:00
|
|
|
|
|
|
|
|
//Hide archived Enquiries
|
|
|
|
|
$('*[data-archived="1"]').hide();
|
|
|
|
|
|
|
|
|
|
$("#show").click(function() {
|
|
|
|
|
$('*[data-archived="1"]').show();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#hide").click(function() {
|
|
|
|
|
$('*[data-archived="1"]').hide(); //No DRY anywhere!
|
|
|
|
|
});
|
|
|
|
|
|
2011-06-27 23:56:13 -07:00
|
|
|
});
|