Make it easier to open a ticket

pull/1/head
yflory 4 years ago
parent 687bb36e0e
commit b1bf592265

@ -126,6 +126,7 @@
.cp-support-collapse {
display: none;
}
cursor: pointer;
}
.cp-support-list-ticket.cp-support-open {
.cp-support-collapsed {

@ -614,20 +614,30 @@ define([
};
};
var addClickHandler = function ($ticket) {
$ticket.on('click', function () {
$ticket.toggleClass('cp-support-open', true);
$ticket.off('click');
});
};
var makeOpenButton = function ($ticket) {
var button = h('button.btn.btn-primary.cp-support-expand', Messages.admin_support_open);
var collapse = h('button.btn.cp-support-collapse', Messages.admin_support_collapse);
$(button).click(function () {
$ticket.toggleClass('cp-support-open', true);
});
$(collapse).click(function () {
addClickHandler($ticket);
$(collapse).click(function (e) {
$ticket.toggleClass('cp-support-open', false);
e.stopPropagation();
setTimeout(function () {
addClickHandler($ticket);
});
});
$ticket.find('.cp-support-title-buttons').prepend([button, collapse]);
$ticket.append(h('div.cp-support-collapsed'));
};
var updateTicketDetails = function ($ticket) {
console.log($ticket.find('.cp-support-message-from'));
var $first = $ticket.find('.cp-support-message-from').first();
var user = $first.find('span').first().html();
var time = $first.find('.cp-support-message-time').text();

@ -774,7 +774,8 @@ define([
$(originalBtn).show();
};
$button.click(function () {
$button.click(function (e) {
e.stopPropagation();
done(true);
});
@ -792,7 +793,8 @@ define([
to = setTimeout(todo, INTERVAL);
};
$(originalBtn).addClass('cp-button-confirm-placeholder').click(function () {
$(originalBtn).addClass('cp-button-confirm-placeholder').click(function (e) {
e.stopPropagation();
// If we have a validation function, continue only if it's true
if (config.validate && !config.validate()) { return; }
i = 1;

Loading…
Cancel
Save