Trigger status notice form when top placeholder form gets used. Delay initialization of notice ajax forms until they get shown.
This commit is contained in:
parent
771682b6eb
commit
f88689cc87
27
js/util.js
27
js/util.js
@ -1292,7 +1292,12 @@ var SN = { // StatusNet
|
|||||||
$('#input_form_nav_'+tag).addClass('current');
|
$('#input_form_nav_'+tag).addClass('current');
|
||||||
|
|
||||||
$('.input_form.current').removeClass('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() {
|
NoticeForm: function() {
|
||||||
if ($('body.user_in').length > 0) {
|
if ($('body.user_in').length > 0) {
|
||||||
$('.ajax-notice').each(function() {
|
// SN.Init.NoticeFormSetup() will get run
|
||||||
var form = $(this);
|
// when forms get displayed for the first time...
|
||||||
SN.Init.NoticeFormSetup(form);
|
|
||||||
|
// 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.
|
// Make inline reply forms self-close when clicking out.
|
||||||
@ -1344,10 +1352,13 @@ var SN = { // StatusNet
|
|||||||
* @param {jQuery} form
|
* @param {jQuery} form
|
||||||
*/
|
*/
|
||||||
NoticeFormSetup: function(form) {
|
NoticeFormSetup: function(form) {
|
||||||
SN.U.NoticeLocationAttach(form);
|
if (!form.data('NoticeFormSetup')) {
|
||||||
SN.U.FormNoticeXHR(form);
|
SN.U.NoticeLocationAttach(form);
|
||||||
SN.U.FormNoticeEnhancements(form);
|
SN.U.FormNoticeXHR(form);
|
||||||
SN.U.NoticeDataAttach(form);
|
SN.U.FormNoticeEnhancements(form);
|
||||||
|
SN.U.NoticeDataAttach(form);
|
||||||
|
form.data('NoticeFormSetup', true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
js/util.min.js
vendored
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user