Fix support UI issues

pull/1/head
yflory 5 years ago
parent 77e893c3ea
commit 8da33c3c72

@ -151,6 +151,7 @@ define([
channel: privateData.support, channel: privateData.support,
curvePublic: user.curvePublic curvePublic: user.curvePublic
}); });
id = Util.uid();
if (sent) { if (sent) {
$('.cp-sidebarlayout-category[data-category="tickets"]').click(); $('.cp-sidebarlayout-category[data-category="tickets"]').click();
} }

@ -41,13 +41,13 @@ define([
var $title = $(form).find('.cp-support-form-title'); var $title = $(form).find('.cp-support-form-title');
var $content = $(form).find('.cp-support-form-msg'); var $content = $(form).find('.cp-support-form-msg');
var title = $title.val(); var title = $title.val().trim();
if (!title) { if (!title) {
return void UI.alert(Messages.support_formTitleError); return void UI.alert(Messages.support_formTitleError);
} }
var content = $content.val(); var content = $content.val().trim();
if (!content) { if (!content) {
return void UI.alert(form, Messages.support_formContentError); return void UI.alert(Messages.support_formContentError);
} }
$content.val(''); $content.val('');
$title.val(''); $title.val('');
@ -160,7 +160,7 @@ define([
'data-hash': hash 'data-hash': hash
}, [ }, [
h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [ h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [
h('span', Messages._getKey('support_from', [content.sender.name])), UI.setHTML(h('span'), Messages._getKey('support_from', [content.sender.name])),
h('span.cp-support-message-time', content.time ? new Date(content.time).toLocaleString() : '') h('span.cp-support-message-time', content.time ? new Date(content.time).toLocaleString() : '')
]), ]),
h('pre.cp-support-message-content', content.message), h('pre.cp-support-message-content', content.message),
@ -177,7 +177,7 @@ define([
'data-hash': hash 'data-hash': hash
}, [ }, [
h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [ h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [
h('span', Messages._getKey('support_from', [content.sender.name])), UI.setHTML(h('span'), Messages._getKey('support_from', [content.sender.name])),
h('span.cp-support-message-time', content.time ? new Date(content.time).toLocaleString() : '') h('span.cp-support-message-time', content.time ? new Date(content.time).toLocaleString() : '')
]), ]),
h('pre.cp-support-message-content', Messages.support_closed) h('pre.cp-support-message-content', Messages.support_closed)

Loading…
Cancel
Save