Revision 9ca32eaa snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/common.js | ||
---|---|---|
643 | 643 |
e.preventDefault(); |
644 | 644 |
e.stopPropagation(); |
645 | 645 |
ui.changeCheckboxState(this); |
646 |
console.log('check clicked'); |
|
647 |
var parentLi = $(this).closest('li'); |
|
648 |
if (parentLi.hasClass('with-checkbox') && parentLi.hasClass('has-more')) { |
|
649 |
$(this).parent().next('.more').stop().slideToggle(400, function() { |
|
650 |
if ($(this).parent().next('.more:visible').length != 0) { |
|
651 |
$(this).find('span').removeClass('snf-checkbox-unchecked').addClass('snf-checkbox-checked'); |
|
652 |
} else { |
|
653 |
$(this).find('span').removeClass('snf-checkbox-checked').addClass('snf-checkbox-unchecked'); |
|
654 |
} |
|
655 |
}); |
|
656 |
} |
|
646 | 657 |
}); |
647 | 658 |
|
648 | 659 |
// for checkboxes created after document.ready |
... | ... | |
654 | 665 |
|
655 | 666 |
|
656 | 667 |
$('.with-checkbox').click(function(e){ |
657 |
e.preventDefault(); |
|
658 |
e.stopPropagation(); |
|
659 |
var checkbox = $(this).find('.check'); |
|
660 |
ui.changeCheckboxState(checkbox); |
|
668 |
console.log('with-checkbox'); |
|
669 |
$(this).find('.check').trigger('click'); |
|
661 | 670 |
}); |
662 | 671 |
|
663 | 672 |
$('.with-checkbox').find('a').click(function(e){ |
Also available in: Unified diff