Converts attachment items to buttons instead of links

This commit is contained in:
Tim van der Meij 2014-04-25 22:42:19 +02:00
parent 094d0e24ce
commit 9d6ffbb3bf
2 changed files with 31 additions and 13 deletions

View file

@ -32,7 +32,6 @@ var DocumentAttachmentsView = function documentAttachmentsView(attachments) {
}
function bindItemLink(domObj, item) {
domObj.href = '#';
domObj.onclick = function documentAttachmentsViewOnclick(e) {
var downloadManager = new DownloadManager();
downloadManager.downloadData(item.content, getFileName(item.filename),
@ -48,10 +47,10 @@ var DocumentAttachmentsView = function documentAttachmentsView(attachments) {
var item = attachments[names[i]];
var div = document.createElement('div');
div.className = 'attachmentsItem';
var a = document.createElement('a');
bindItemLink(a, item);
a.textContent = getFileName(item.filename);
div.appendChild(a);
var button = document.createElement('button');
bindItemLink(button, item);
button.textContent = getFileName(item.filename);
div.appendChild(button);
attachmentsView.appendChild(div);
}
};