-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck-all-mail.js
54 lines (54 loc) · 2.07 KB
/
check-all-mail.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$(function() {
'use strict'
$('#checkAll').on('click', function() {
if ($(this).is(':checked')) {
$('.main-mail-list .ckbox input').each(function() {
$(this).closest('.main-mail-item').addClass('selected');
$(this).attr('checked', true);
});
$('.main-mail-options .btn:not(:first-child)').removeClass('disabled');
} else {
$('.main-mail-list .ckbox input').each(function() {
$(this).closest('.main-mail-item').removeClass('selected');
$(this).attr('checked', false);
});
$('.main-mail-options .btn:not(:first-child)').addClass('disabled');
}
});
$('.main-mail-item .main-mail-checkbox input').on('click', function() {
if ($(this).is(':checked')) {
$(this).attr('checked', false);
$(this).closest('.main-mail-item').addClass('selected');
$('.main-mail-options .btn:not(:first-child)').removeClass('disabled');
} else {
$(this).attr('checked', true);
$(this).closest('.main-mail-item').removeClass('selected');
if (!$('.main-mail-list .selected').length) {
$('.main-mail-options .btn:not(:first-child)').addClass('disabled');
}
}
});
$('.main-mail-star').on('click', function(e) {
$(this).toggleClass('active');
});
$('#btnCompose').on('click', function(e) {
e.preventDefault();
$('.main-mail-compose').show();
});
$('.main-mail-compose-header a:first-child').on('click', function(e) {
e.preventDefault();
$('.main-mail-compose').toggleClass('main-mail-compose-minimize');
})
$('.main-mail-compose-header a:nth-child(2)').on('click', function(e) {
e.preventDefault();
$(this).find('.fas').toggleClass('fa-compress');
$(this).find('.fas').toggleClass('fa-expand');
$('.main-mail-compose').toggleClass('main-mail-compose-compress');
$('.main-mail-compose').removeClass('main-mail-compose-minimize');
});
$('.main-mail-compose-header a:last-child').on('click', function(e) {
e.preventDefault();
$('.main-mail-compose').hide(100);
$('.main-mail-compose').removeClass('main-mail-compose-minimize');
});
});