diff --git a/4chan_x.user.js b/4chan_x.user.js index d1593e950..1fe1112bb 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1435,6 +1435,7 @@ var url; this.file = file; this.el.title = file.name; + if (this === qr.selected) $('#filename', qr.el).textContent = file.name; if (file.type === 'application/pdf') { this.el.style.backgroundImage = null; return; @@ -1459,6 +1460,7 @@ data = _ref2[_i]; $("[name=" + data + "]", qr.el).value = this[data]; } + $('#filename', qr.el).textContent = this.file ? this.file.name : null; return $('#spoiler', qr.el).checked = this.spoiler; }; @@ -1568,7 +1570,7 @@ }); qr.mimeTypes = mimeTypes.split(', '); qr.spoiler = !!$('#com_submit + label'); - qr.el = ui.dialog('qr', 'top:0;right:0;', "
Quick Reply " + (g.REPLY ? '' : threads) + " x
+
"); + qr.el = ui.dialog('qr', 'top:0;right:0;', "
Quick Reply " + (g.REPLY ? '' : threads) + " x
+
"); if (!g.REPLY) { $.on($('select', qr.el), 'mousedown', function(e) { return e.stopPropagation(); @@ -3659,7 +3661,7 @@ textarea.field {\ position: absolute;\ visibility: hidden;\ }\ -#fileInfo {\ +#filename {\ box-sizing: border-box;\ -moz-box-sizing: border-box;\ display: inline-block;\ diff --git a/script.coffee b/script.coffee index 7fd298704..f7965b69c 100644 --- a/script.coffee +++ b/script.coffee @@ -1052,6 +1052,8 @@ qr = qr.replies.push @ setFile: (@file) -> @el.title = file.name + if @ is qr.selected + $('#filename', qr.el).textContent = file.name if file.type is 'application/pdf' @el.style.backgroundImage = null return @@ -1070,7 +1072,8 @@ qr = @el.parentNode.scrollLeft += rectEl.left + rectEl.width/2 - rectList.left - rectList.width/2 for data in ['name', 'email', 'sub', 'com'] $("[name=#{data}]", qr.el).value = @[data] - $('#spoiler', qr.el).checked = @spoiler + $('#filename', qr.el).textContent = if @file then @file.name else null + $('#spoiler', qr.el).checked = @spoiler rm: -> $.rm @el index = qr.replies.indexOf @ @@ -1158,7 +1161,7 @@ qr =
-
+
@@ -2896,7 +2899,7 @@ textarea.field { position: absolute; visibility: hidden; } -#fileInfo { +#filename { box-sizing: border-box; -moz-box-sizing: border-box; display: inline-block;