06/03/2024 9h19
This commit is contained in:
51
assets/script/checkbox.js
Normal file
51
assets/script/checkbox.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Created by Glee on 03-Nov-2020.
|
||||
*/
|
||||
|
||||
const Checkbox = function (deleteItemCb){
|
||||
|
||||
const INPUT_CHECKBOX_CLASS = '.js-checkbox-id';
|
||||
let _deleteItemCb = deleteItemCb;
|
||||
|
||||
return {
|
||||
setAllChecked,
|
||||
getCheckedIds,
|
||||
deleteSelected
|
||||
}
|
||||
|
||||
function setAllChecked() {
|
||||
var all_checkboxes = $(INPUT_CHECKBOX_CLASS);
|
||||
|
||||
if($(this).is(':checked')) {
|
||||
all_checkboxes.each(function (index, item) {
|
||||
$(item).prop( "checked", true);
|
||||
})
|
||||
}else{
|
||||
all_checkboxes.each(function (index, item) {
|
||||
$(item).prop( "checked", false);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSelected() {
|
||||
if(!confirm('Bạn chắc chắn muốn xóa ?')) {
|
||||
return ;
|
||||
}
|
||||
|
||||
$(INPUT_CHECKBOX_CLASS).each(function (index, item) {
|
||||
if($(item).is(':checked')) {
|
||||
//delete_deal(item.value, false);
|
||||
_deleteItemCb(item.value)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getCheckedIds() {
|
||||
let list_ids = [];
|
||||
$(INPUT_CHECKBOX_CLASS).each(function (index, item) {
|
||||
if($(item).is(':checked')) list_ids.push(item.value);
|
||||
});
|
||||
|
||||
return list_ids;
|
||||
}
|
||||
};
|
||||
@@ -735,6 +735,11 @@ input[type=radio]:focus:before {
|
||||
height: 16px;
|
||||
background-position: -224px -88px;
|
||||
}
|
||||
.icons.icon-upload {
|
||||
background-position: -2px -43px;
|
||||
transform: rotate(-90deg);
|
||||
filter: invert(60%) sepia(90%) saturate(6183%) hue-rotate(228deg) brightness(92%) contrast(101%);
|
||||
}
|
||||
|
||||
.admin-header-container .menu-hide {
|
||||
margin-left: 30px;
|
||||
@@ -907,6 +912,11 @@ input[type=radio]:focus:before {
|
||||
border: 1px solid #ececec;
|
||||
}
|
||||
|
||||
.table-vertical-inherit tbody td {
|
||||
padding: 8px;
|
||||
vertical-align: inherit;
|
||||
}
|
||||
|
||||
.autocomplete-suggestions .item {
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #ededed;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -743,6 +743,11 @@ input[type="radio"] {
|
||||
height: 16px;
|
||||
background-position: -224px -88px;
|
||||
}
|
||||
&.icon-upload {
|
||||
background-position: -2px -43px;
|
||||
transform: rotate(-90deg);
|
||||
filter: invert(60%) sepia(90%) saturate(6183%) hue-rotate(228deg) brightness(92%) contrast(101%);
|
||||
}
|
||||
}
|
||||
|
||||
.admin-header-container {
|
||||
@@ -931,6 +936,14 @@ input[type="radio"] {
|
||||
border: 1px solid #ececec;
|
||||
}
|
||||
}
|
||||
.table-vertical-inherit{
|
||||
tbody {
|
||||
td{
|
||||
padding: 8px;
|
||||
vertical-align: inherit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.autocomplete-suggestions {
|
||||
.item {
|
||||
|
||||
Reference in New Issue
Block a user