Skip to content
Snippets Groups Projects
Commit d766399f authored by VladimirCherkasov's avatar VladimirCherkasov
Browse files

fixes in supportDialog.js

parent f49447c7
No related merge requests found
$(function(){
$('#errButton').click(function ()
{
$.get(URLdir + "window/support", function(data){
$(function () {
var isInit = false;
$('#errButton').click(function () {
$.get(URLdir + "window/support", function (data) {
wnd.open(JSON.parse(data));
if (!isInit) {
$('#imageFile').change(function () {
document.forms["loadPicture"].submit();
// now result in #hiddenframe :-/
$("#hiddenframe").load(function () {
var ret = this.contentWindow.document.body.innerHTML;
// console.log(ret);
});
});
isInit = true;
}
});
});
var err_ready = true;
// $('#imageFile').change(function () { // does not work
$(document).on('change', '#imageFile', function () {
document.forms["loadPicture"].submit();
// now result in #hiddenframe :-/
$("#hiddenframe").load(function () {
var ret = this.contentWindow.document.body.innerHTML;
// console.log(ret);
});
});
var errReady = true;
$(document)
.on('click', '#dialogSendButton', function()
{
.on('click', '#dialogSendButton', function () {
var jMessageTitle = $('#messageTitle');
var jMessage = $('#message');
var jSendBut = $('#dialogSendButton');
if (!err_ready)
if (!errReady)
return;
err_ready = false;
errReady = false;
// Save and erase
var mesTitle = jMessageTitle.val();
var mesText = jMessage.val();
if(mesTitle.length <= 0 || mesText.length <= 0) {
if (mesTitle.length <= 0 || mesText.length <= 0) {
var vMessage = (mesTitle.length <= 0)
? 'Вы не ввели тему сообщения' : 'Вы не ввели сообщение';
EventInspector_ShowMsg(vMessage, 'error');
err_ready = true;
errReady = true;
return;
}
......@@ -49,16 +47,14 @@ $(function(){
$.ajax({
type: "POST",
url: URLdir + "handler/ErrMessages/createRequest",
data:
{
data: {
title: mesTitle,
text: mesText
},
success: function(data)
{
err_ready = true;
success: function (data) {
errReady = true;
data = $.parseJSON(data);
if(data.success === true) {
if (data.success === true) {
EventInspector_ShowMsg('Сообщение успешно отправлено!', 'success');
jMessageTitle.val('');
jMessage.val('');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment