We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 6066bce0 authored by Brion Vibber's avatar Brion Vibber

Clicking outside the active top posting form now returns to the placeholder if...

Clicking outside the active top posting form now returns to the placeholder if all textarea/input fields are empty
parent b89b89ce
......@@ -1323,6 +1323,21 @@ var SN = { // StatusNet
// Make inline reply forms self-close when clicking out.
$('body').bind('click', function(e) {
var currentForm = $('#content .input_forms div.current');
if (currentForm.length > 0) {
if ($('#content .input_forms').has(e.target).length == 0) {
// If all fields are empty, switch back to the placeholder.
var fields = currentForm.find('textarea, input[type=text], input[type=""]');
var anything = false;
fields.each(function() {
anything = anything || $(this).val();
});
if (!anything) {
SN.U.switchInputFormTab("placeholder");
}
}
}
var openReplies = $('li.notice-reply');
if (openReplies.length > 0) {
var target = $(e.target);
......
Markdown is supported
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