File: //home/arjun/projects/buyercall_new/buyercall/buyercall/static/js/pages/readyInbox.js
/*
* Document : readyInbox.js
* Author : pixelcave
* Description: Custom javascript code used in Inbox page
*/
var ReadyInbox = function() {
return {
init: function() {
// Choose one of the highlight classes for the message list rows: 'active', 'success', 'warning', 'danger'
var rowHighlightClass = 'warning';
/* Add/Remove row highlighting on checkbox click */
$('tbody input:checkbox').click(function() {
var checkedStatus = $(this).prop('checked');
var tableRow = $(this).closest('tr');
if (checkedStatus) {
tableRow.addClass(rowHighlightClass);
} else {
tableRow.removeClass(rowHighlightClass);
}
});
/* Toggle on/off star buttons */
$('.msg-fav-btn').click(function(){
$(this).toggleClass('text-muted text-warning');
$('i', this).toggleClass('fa-star-o fa-star');
// You could give the star buttons unique ids related with each message
// and use it - $(this).prop('id') - to update with your back end :-)
});
/* Show/Hide Message view - Just for preview */
var inboxList = $('#message-list');
var inboxView = $('#message-view');
inboxList.find('h4 > a').on('click', function(){
inboxList
.removeClass('animation-fadeInQuick')
.addClass('display-none');
inboxView
.removeClass('display-none')
.addClass('animation-fadeInQuick');
});
inboxView.find('#message-view-back').on('click', function(){
inboxView
.removeClass('animation-fadeInQuick')
.addClass('display-none');
inboxList
.removeClass('display-none')
.addClass('animation-fadeInQuick');
});
}
};
}();