Remove reply button is now working.
This commit is contained in:
parent
050a128aa6
commit
deb4742b24
@ -1333,6 +1333,10 @@
|
|||||||
$.on(this.el, 'click', function() {
|
$.on(this.el, 'click', function() {
|
||||||
return _this.select();
|
return _this.select();
|
||||||
});
|
});
|
||||||
|
$.on($('.remove', this.el), 'click', function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
return _this.rm();
|
||||||
|
});
|
||||||
if (file) this.setFile(file);
|
if (file) this.setFile(file);
|
||||||
$.before($('#addReply', qr.el), this.el);
|
$.before($('#addReply', qr.el), this.el);
|
||||||
qr.replies.push(this);
|
qr.replies.push(this);
|
||||||
@ -1367,9 +1371,18 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
_Class.prototype.rm = function() {
|
_Class.prototype.rm = function() {
|
||||||
var url;
|
var index, url;
|
||||||
|
$.rm(this.el);
|
||||||
|
index = qr.replies.indexOf(this);
|
||||||
|
if (qr.replies.length === 1) {
|
||||||
|
new qr.reply().select();
|
||||||
|
} else if (this.el.id === 'selected') {
|
||||||
|
(qr.replies[index - 1] || qr.replies[index + 1]).select();
|
||||||
|
}
|
||||||
|
qr.replies.splice(index, 1);
|
||||||
url = window.URL || window.webkitURL;
|
url = window.URL || window.webkitURL;
|
||||||
return url.revokeObjectURL(this.url);
|
url.revokeObjectURL(this.url);
|
||||||
|
return delete this;
|
||||||
};
|
};
|
||||||
|
|
||||||
return _Class;
|
return _Class;
|
||||||
|
|||||||
@ -1000,6 +1000,9 @@ qr =
|
|||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
innerHTML: '<a class=remove title=Remove>x</a><label hidden><input type=checkbox></label><span></span>'
|
innerHTML: '<a class=remove title=Remove>x</a><label hidden><input type=checkbox></label><span></span>'
|
||||||
$.on @el, 'click', => @select()
|
$.on @el, 'click', => @select()
|
||||||
|
$.on $('.remove', @el), 'click', (e) =>
|
||||||
|
e.stopPropagation()
|
||||||
|
@rm()
|
||||||
@setFile file if file
|
@setFile file if file
|
||||||
$.before $('#addReply', qr.el), @el
|
$.before $('#addReply', qr.el), @el
|
||||||
qr.replies.push @
|
qr.replies.push @
|
||||||
@ -1019,9 +1022,16 @@ qr =
|
|||||||
for data in ['name', 'email', 'sub', 'com']
|
for data in ['name', 'email', 'sub', 'com']
|
||||||
$("[name=#{data}]", qr.el).value = @[data]
|
$("[name=#{data}]", qr.el).value = @[data]
|
||||||
rm: ->
|
rm: ->
|
||||||
# rm reply from qr.replies and the UI
|
$.rm @el
|
||||||
|
index = qr.replies.indexOf @
|
||||||
|
if qr.replies.length is 1
|
||||||
|
new qr.reply().select()
|
||||||
|
else if @el.id is 'selected'
|
||||||
|
(qr.replies[index-1] or qr.replies[index+1]).select()
|
||||||
|
qr.replies.splice index, 1
|
||||||
url = window.URL or window.webkitURL
|
url = window.URL or window.webkitURL
|
||||||
url.revokeObjectURL @url
|
url.revokeObjectURL @url
|
||||||
|
delete @
|
||||||
|
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user