$(function() {
var form = $('form.board-form'),
list_type = 'default',
module_method = list_type == 'card' ? 'masonry' : 'lists';
new $.module['board.' + module_method](
form, {
'callback': function($this) {
$('.change').ui_swap({
'Yes': ['공개', '#18A689'],
'No': ['비공개', "#f26520"]
});
if (list_type == 'faq') {
$('.faq-group .q').on('click', function(e) {
if (e.target == this) {
var a = $(this).next('.a'),
group = $(this).parent('.faq-group');
if (group.hasClass('active') == false) {
group.addClass('active');
a.slideDown();
} else {
group.removeClass('active');
a.slideUp();
}
return false;
}
});
}
}
}
);
$('.management', form).on(
'click',
function(e) {
if (e.target.type != 'checkbox') {
if ($('.ids:checked', form).length < 1) {
alert('관리하실 게시물을 선택해 주세요');
return false;
}
new $.module['modal'](
'/sub0401/pm_management/page/10/view/id/1718/sub0401/sub020501/sub020201', {
'title': '게시물관리 (%s건)'.sprintf($('.ids:checked', form).length),
'close': false,
'iframe': true,
'width': 770,
'onclose': function() {}
}
);
}
}
)
.find('input').on(
'change',
function() {
$('.ids', form).attr('checked', this.checked);
}
);
});