Add basket
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
var ml = {
|
||||
|
||||
init: function() {
|
||||
ml.ui.init();
|
||||
},
|
||||
|
||||
ui: {
|
||||
|
||||
init: function() {
|
||||
$('input[type=checkbox].select_all').click(function() {
|
||||
$('input[type=checkbox].'+$(this).attr('id')).attr('checked', $(this).attr('checked') == 'checked');
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
basket: {
|
||||
|
||||
init: function() {
|
||||
$('#basket_list_copy').click(ml.basket.showModal);
|
||||
$('#basket_list_close').click(ml.basket.hideModal);
|
||||
},
|
||||
|
||||
showModal: function() {
|
||||
var list = '';
|
||||
$('input[type=checkbox][name="items[]"]').each(function() {
|
||||
list += $(this).val() + "\n";
|
||||
});
|
||||
|
||||
$('#basket_list_text').val(list);
|
||||
$('#basket_list').modal('show');
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
hideModal: function() {
|
||||
$('#basket_list').modal('hide');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('document').ready(ml.init);
|
||||
Reference in New Issue
Block a user