This commit is contained in:
2023-08-17 14:24:34 +03:00
parent d976ce9c89
commit dd8551c0c6
4 changed files with 236 additions and 32 deletions

View File

@@ -85,6 +85,34 @@ chatSocket.onmessage = function (e) {
}
}
}
if (data.tickets_w_manager_html) {
if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) {
document.querySelector(".list_linked_tickets").innerHTML = data.tickets_w_manager_html
if (el_tab !== null){
document.querySelector(".tab_user_messanger.select").classList.remove("select")
let old_insert_tab = document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]`)
if (old_insert_tab) {
old_insert_tab.classList.add("select")
old_insert_tab.scrollIntoView({behavior: "smooth"});
}
}
let container_messenger = document.querySelector(".container-messages")
if (container_messenger){
let dataset_cont_mes = container_messenger.dataset
if (dataset_cont_mes){
let ticket_id = dataset_cont_mes["ticketId"]
if (ticket_id !== ""){
let ticket = document.querySelector(`[data-cur-receiver-item="${ticket_id}"]`)
if (!ticket){
let chat = document.querySelector(".block-chat").innerHTML = ""
}
}
}
}
}
}
if (data.tickets_wo_manager_html) {
if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) {
document.querySelector(".list_unlinked_tickets").innerHTML = data.tickets_wo_manager_html
@@ -98,24 +126,25 @@ chatSocket.onmessage = function (e) {
old_insert_tab.classList.add("select")
old_insert_tab.scrollIntoView({behavior: "smooth"});
}
}
}
}
if (data.tickets_w_manager_html) {
if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) {
document.querySelector(".list_linked_tickets").innerHTML = data.tickets_w_manager_html
if (el_tab !== null){
document.querySelector(".tab_user_messanger.select").classList.remove("select")
let old_insert_tab = document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]`)
if (old_insert_tab) {
old_insert_tab.classList.add("select")
old_insert_tab.scrollIntoView({behavior: "smooth"});
}
let container_messenger = document.querySelector(".container-messages")
if (container_messenger){
let dataset_cont_mes = container_messenger.dataset
if (dataset_cont_mes){
let ticket_id = dataset_cont_mes["ticketId"]
if (ticket_id !== ""){
let ticket = document.querySelector(`[data-cur-receiver-item="${ticket_id}"]`)
if (!ticket){
let chat = document.querySelector(".block-chat").innerHTML = ""
}
}
}
}
}
} else {
}
else {
let list_of_users = document.querySelector(".block-list-of-users")
if (list_of_users !== null){
if (data.users_list_html){

View File

@@ -0,0 +1,58 @@
var $range = $(".js-range-slider"),
$inputFrom = $(".js-input-from"),
$inputTo = $(".js-input-to"),
instance,
min = 0,
max = 1000,
from = 0,
to = 0;
$range.ionRangeSlider({
skin: "round",
type: "double",
min: min,
max: max,
from: 200,
to: 800,
onStart: updateInputs,
onChange: updateInputs
});
instance = $range.data("ionRangeSlider");
function updateInputs (data) {
from = data.from;
to = data.to;
$inputFrom.prop("value", from);
$inputTo.prop("value", to);
}
$inputFrom.on("input", function () {
var val = $(this).prop("value");
// validate
if (val < min) {
val = min;
} else if (val > to) {
val = to;
}
instance.update({
from: val
});
});
$inputTo.on("input", function () {
var val = $(this).prop("value");
// validate
if (val < from) {
val = from;
} else if (val > max) {
val = max;
}
instance.update({
to: val
});
});