|
|
|
@ -1,5 +1,4 @@ |
|
|
|
var editor = null; |
|
|
|
(function ($) { |
|
|
|
$(function () { |
|
|
|
|
|
|
|
var $container = $("#qa-new-post-container"); |
|
|
|
var $editorContainer = $container.find(".new-post-editor"); |
|
|
|
@ -72,6 +71,8 @@ |
|
|
|
load: function () { |
|
|
|
$editorContainer.find(".loading-cover").remove(); |
|
|
|
$submitButton.prop("disabled", false); |
|
|
|
$form.data("validator").settings.ignore = '.ignore'; |
|
|
|
$editorContainer.find(':input').addClass('ignore'); |
|
|
|
} |
|
|
|
} |
|
|
|
}).data(editorDataKey); |
|
|
|
@ -82,6 +83,13 @@ |
|
|
|
var postText = newPostEditor.getMarkdown(); |
|
|
|
$postTextInput.val(postText); |
|
|
|
|
|
|
|
if (!$form.valid()) { |
|
|
|
var validationResult = $form.validate(); |
|
|
|
abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML.
|
|
|
|
e.preventDefault(); |
|
|
|
return false; //for old browsers
|
|
|
|
} |
|
|
|
|
|
|
|
$submitButton.buttonBusy(); |
|
|
|
$(this).off('submit').submit(); |
|
|
|
}); |
|
|
|
@ -113,4 +121,4 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
})(jQuery); |
|
|
|
}); |
|
|
|
|