rearange img / input
This commit is contained in:
parent
dc19a799a7
commit
4012156128
@ -1259,12 +1259,12 @@
|
||||
var box, file, files;
|
||||
files = $('#files', QR.qr);
|
||||
box = $.el('li', {
|
||||
innerHTML: "<input type=file name=upfile accept='" + QR.accept + "'><img alt='click here'><a class=x>X</a>"
|
||||
innerHTML: "<img alt='click here'><input type=file name=upfile accept='" + QR.accept + "'><a class=x>X</a>"
|
||||
});
|
||||
file = $('input', box);
|
||||
$.bind(file, 'change', QR.change);
|
||||
$.bind($('img', box), 'click', function() {
|
||||
return this.previousSibling.click();
|
||||
return this.nextSibling.click();
|
||||
});
|
||||
$.bind($('.x', box), 'click', QR.rmThumb);
|
||||
$.add(files, box);
|
||||
@ -1336,7 +1336,7 @@
|
||||
}
|
||||
qr = QR.qr;
|
||||
fr = new FileReader();
|
||||
img = this.nextSibling;
|
||||
img = this.previousSibling;
|
||||
fr.onload = function(e) {
|
||||
return img.src = e.target.result;
|
||||
};
|
||||
|
||||
@ -973,10 +973,10 @@ QR =
|
||||
#$('#autopost', QR.qr).checked = true
|
||||
files = $ '#files', QR.qr
|
||||
box = $.el 'li',
|
||||
innerHTML: "<input type=file name=upfile accept='#{QR.accept}'><img alt='click here'><a class=x>X</a>"
|
||||
innerHTML: "<img alt='click here'><input type=file name=upfile accept='#{QR.accept}'><a class=x>X</a>"
|
||||
file = $ 'input', box
|
||||
$.bind file, 'change', QR.change
|
||||
$.bind $('img', box), 'click', -> @previousSibling.click()
|
||||
$.bind $('img', box), 'click', -> @nextSibling.click()
|
||||
$.bind $('.x', box), 'click', QR.rmThumb
|
||||
$.add files, box
|
||||
file.click()
|
||||
@ -1028,7 +1028,7 @@ QR =
|
||||
return
|
||||
{qr} = QR
|
||||
fr = new FileReader()
|
||||
img = @nextSibling
|
||||
img = @previousSibling
|
||||
fr.onload = (e) ->
|
||||
img.src = e.target.result
|
||||
fr.readAsDataURL file
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user