dialog confirmation for publish unpublish

This commit is contained in:
Zachary Chai
2016-11-07 17:19:54 -05:00
parent 9fad2a4ef8
commit bc7a77ef77
5 changed files with 35 additions and 2 deletions

View File

@ -11,6 +11,14 @@
var rowData = table.row("#"+data.record_id).data();
rowData.published = data.published
table.row("#"+data.record_id).data(rowData).draw();
var publish = (data.published) ? 'publish' : 'unpublish';
// show alert success alert
$('.alert-template .alert-message').html($('.'+publish+'-alert').html());
$('#alerts').html($('.alert-template').html());
setTimeout(function() {
$('#alerts > .alert').alert('close');
}, 4000);
}
});
};

View File

@ -13,6 +13,15 @@ html, body {
background: linear-gradient(0, white 65%, #4DC0A2 35%);
}
#alerts {
position: absolute;
top: 10px;
left: 50%;
margin-left: -250px;
width: 500px;
z-index: 999;
}
.header {
padding: 20px 40px;