setsearch.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. $(function()
  2. {
  3. $('[name^=' + window.mode + ']').change(function()
  4. {
  5. var checked = $(this).prop('checked');
  6. $(this).parents('.settingBox').find('.fieldBox').toggle(checked);
  7. $(this).parents('.settingBox').find('[name^=checkAll], [name^=fields]').prop('checked', checked);
  8. });
  9. $('[name^=checkAll]').change(function()
  10. {
  11. var checked = $(this).prop('checked');
  12. $(this).parents('.fieldBox').find('[name^=fields]').prop('checked', checked);
  13. });
  14. $('#submit').click(function()
  15. {
  16. /* Check if checked the fields to search. */
  17. var emptySearch = $('[name^=' + window.mode + ']').prop('checked') && $('[name^=fields]:checked').length == 0;
  18. if(!emptySearch)
  19. {
  20. $('#ajaxForm').submit();
  21. return false;
  22. }
  23. bootbox.confirm(window.emptySearch, function(result)
  24. {
  25. if(result)
  26. {
  27. $('#ajaxForm').submit();
  28. }
  29. });
  30. return false;
  31. });
  32. $('.sortable .checkbox label').append("<i class='icon-move'></i>");
  33. $('.sortable').sortable({trigger: '.icon-move'});
  34. });