horizontal scrolling

This commit is contained in:
James Campos 2011-09-07 17:18:54 -07:00
parent 0c99311b8d
commit 22f5597e6f
2 changed files with 27 additions and 11 deletions

View File

@ -1259,20 +1259,20 @@
}
},
attach: function() {
var div, file, files;
var box, file, files;
files = $('#files', QR.qr);
div = $.el('div', {
box = $.el('span', {
innerHTML: "<input type=file name=upfile accept='" + QR.accept + "'><img alt='click here'><a class=x>X</a>"
});
file = $('input', div);
file = $('input', box);
$.bind(file, 'change', QR.change);
$.bind($('img', div), 'click', function() {
$.bind($('img', box), 'click', function() {
return this.previousSibling.click();
});
$.bind($('.x', div), 'click', function() {
$.bind($('.x', box), 'click', function() {
return $.rm(this.parentNode);
});
$.add(files, div);
$.add(files, box);
return file.click();
},
captchaNode: function(e) {
@ -3132,6 +3132,14 @@
#qr #captcha {\
position: relative;\
}\
#qr #files {\
width: 300px;\
white-space: nowrap;\
overflow: auto;\
}\
#qr #files span {\
position: relative;\
}\
#qr #files a {\
position: absolute;\
left: 0;\

View File

@ -969,13 +969,13 @@ QR =
attach: ->
#$('#autopost', QR.qr).checked = true
files = $ '#files', QR.qr
div = $.el 'div',
box = $.el 'span',
innerHTML: "<input type=file name=upfile accept='#{QR.accept}'><img alt='click here'><a class=x>X</a>"
file = $ 'input', div
file = $ 'input', box
$.bind file, 'change', QR.change
$.bind $('img', div), 'click', -> @previousSibling.click()
$.bind $('.x', div), 'click', -> $.rm @parentNode
$.add files, div
$.bind $('img', box), 'click', -> @previousSibling.click()
$.bind $('.x', box), 'click', -> $.rm @parentNode
$.add files, box
file.click()
captchaNode: (e) ->
QR.captcha =
@ -2449,6 +2449,14 @@ main =
#qr #captcha {
position: relative;
}
#qr #files {
width: 300px;
white-space: nowrap;
overflow: auto;
}
#qr #files span {
position: relative;
}
#qr #files a {
position: absolute;
left: 0;