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

Commit f88689cc authored by Brion Vibber's avatar Brion Vibber

Trigger status notice form when top placeholder form gets used. Delay...

Trigger status notice form when top placeholder form gets used. Delay initialization of notice ajax forms until they get shown.
parent 771682b6
......@@ -1292,7 +1292,12 @@ var SN = { // StatusNet
$('#input_form_nav_'+tag).addClass('current');
$('.input_form.current').removeClass('current');
$('#input_form_'+tag).addClass('current');
$('#input_form_'+tag)
.addClass('current')
.find('.ajax-notice').each(function() {
var form = $(this);
SN.Init.NoticeFormSetup(form);
});
}
},
......@@ -1307,9 +1312,12 @@ var SN = { // StatusNet
*/
NoticeForm: function() {
if ($('body.user_in').length > 0) {
$('.ajax-notice').each(function() {
var form = $(this);
SN.Init.NoticeFormSetup(form);
// SN.Init.NoticeFormSetup() will get run
// when forms get displayed for the first time...
// Hack to initialize the placeholder at top
$('#input_form_placeholder input.placeholder').focus(function() {
SN.U.switchInputFormTab("status");
});
// Make inline reply forms self-close when clicking out.
......@@ -1344,10 +1352,13 @@ var SN = { // StatusNet
* @param {jQuery} form
*/
NoticeFormSetup: function(form) {
SN.U.NoticeLocationAttach(form);
SN.U.FormNoticeXHR(form);
SN.U.FormNoticeEnhancements(form);
SN.U.NoticeDataAttach(form);
if (!form.data('NoticeFormSetup')) {
SN.U.NoticeLocationAttach(form);
SN.U.FormNoticeXHR(form);
SN.U.FormNoticeEnhancements(form);
SN.U.NoticeDataAttach(form);
form.data('NoticeFormSetup', true);
}
},
/**
......
This diff is collapsed.
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