forked from GNUsocial/gnu-social
Refactored repeat confirmation dialog. Also fixes dialog skipping.
This commit is contained in:
parent
2600ad9643
commit
e8428d1d52
46
js/util.js
46
js/util.js
@ -356,43 +356,45 @@ var SN = { // StatusNet
|
|||||||
},
|
},
|
||||||
|
|
||||||
NoticeRepeat: function() {
|
NoticeRepeat: function() {
|
||||||
$('.form_repeat').live('click', function() {
|
$('.form_repeat').live('click', function(e) {
|
||||||
SN.U.FormXHR($(this));
|
e.preventDefault();
|
||||||
|
|
||||||
SN.U.NoticeRepeatConfirmation($(this));
|
SN.U.NoticeRepeatConfirmation($(this));
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
NoticeRepeatConfirmation: function(form) {
|
NoticeRepeatConfirmation: function(form) {
|
||||||
function NRC() {
|
var submit_i = form.find('.submit');
|
||||||
form.closest('.notice-options').addClass('opaque');
|
|
||||||
form.addClass('dialogbox');
|
var submit = submit_i.clone();
|
||||||
|
submit
|
||||||
|
.addClass('submit_dialogbox')
|
||||||
|
.removeClass('submit');
|
||||||
|
form.append(submit);
|
||||||
|
submit.bind('click', function() { SN.U.FormXHR(form); return false; });
|
||||||
|
|
||||||
|
submit_i.hide();
|
||||||
|
|
||||||
|
form
|
||||||
|
.addClass('dialogbox')
|
||||||
|
.append('<button class="close">×</button>')
|
||||||
|
.closest('.notice-options')
|
||||||
|
.addClass('opaque');
|
||||||
|
|
||||||
form.append('<button class="close">×</button>');
|
|
||||||
form.find('button.close').click(function(){
|
form.find('button.close').click(function(){
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
|
|
||||||
form.closest('.notice-options').removeClass('opaque');
|
form
|
||||||
form.removeClass('dialogbox');
|
.removeClass('dialogbox')
|
||||||
|
.closest('.notice-options')
|
||||||
|
.removeClass('opaque');
|
||||||
|
|
||||||
form.find('.submit_dialogbox').remove();
|
form.find('.submit_dialogbox').remove();
|
||||||
form.find('.submit').show();
|
form.find('.submit').show();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
form.find('.submit').bind('click', function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var submit = form.find('.submit').clone();
|
|
||||||
submit.addClass('submit_dialogbox');
|
|
||||||
submit.removeClass('submit');
|
|
||||||
form.append(submit);
|
|
||||||
|
|
||||||
$(this).hide();
|
|
||||||
|
|
||||||
NRC();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
NoticeAttachments: function() {
|
NoticeAttachments: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user