This commit is contained in:
Jordan Bates 2013-08-23 10:52:33 -07:00
parent 1cb46eef80
commit 7fa776a9c5
3 changed files with 42 additions and 3 deletions

View File

@ -5582,7 +5582,22 @@
}
return post.setFile(file);
},
openFileInput: function() {
openFileInput: function(e) {
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
}
if (e.ctrlKey && e.type === 'click') {
$.addClass(QR.nodes.filename, 'edit');
QR.nodes.filename.focus();
return $.on(QR.nodes.filename, 'blur', function() {
return $.rmClass(QR.nodes.filename, 'edit');
});
}
if (e.target.nodeName === 'INPUT' || (e.keyCode && ![32, 13].contains(e.keyCode)) || e.ctrlKey) {
return;
}
e.preventDefault();
return QR.nodes.fileInput.click();
},
posts: [],

View File

@ -5592,7 +5592,22 @@
}
return post.setFile(file);
},
openFileInput: function() {
openFileInput: function(e) {
e.stopPropagation();
if (e.shiftKey && e.type === 'click') {
return QR.selected.rmFile();
}
if (e.ctrlKey && e.type === 'click') {
$.addClass(QR.nodes.filename, 'edit');
QR.nodes.filename.focus();
return $.on(QR.nodes.filename, 'blur', function() {
return $.rmClass(QR.nodes.filename, 'edit');
});
}
if (e.target.nodeName === 'INPUT' || (e.keyCode && ![32, 13].contains(e.keyCode)) || e.ctrlKey) {
return;
}
e.preventDefault();
return QR.nodes.fileInput.click();
},
posts: [],

View File

@ -495,7 +495,16 @@ QR =
post = new QR.post()
post.setFile file
openFileInput: ->
openFileInput: (e) ->
e.stopPropagation()
if e.shiftKey and e.type is 'click'
return QR.selected.rmFile()
if e.ctrlKey and e.type is 'click'
$.addClass QR.nodes.filename, 'edit'
QR.nodes.filename.focus()
return $.on QR.nodes.filename, 'blur', -> $.rmClass QR.nodes.filename, 'edit'
return if e.target.nodeName is 'INPUT' or (e.keyCode and not [32, 13].contains e.keyCode) or e.ctrlKey
e.preventDefault()
QR.nodes.fileInput.click()
posts: []