[Pkg-javascript-commits] [pdf.js] 23/210: Converts attachment items to buttons instead of links
David Prévot
taffit at moszumanska.debian.org
Thu Jun 5 14:20:57 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch upstream
in repository pdf.js.
commit 9d6ffbb3bf7dd0825e59585fea1e08f403b2285a
Author: Tim van der Meij <timvandermeij at gmail.com>
Date: Fri Apr 25 22:42:19 2014 +0200
Converts attachment items to buttons instead of links
---
web/document_attachments_view.js | 9 ++++-----
web/viewer.css | 33 ++++++++++++++++++++++++++-------
2 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/web/document_attachments_view.js b/web/document_attachments_view.js
index 3637124..c8477dc 100644
--- a/web/document_attachments_view.js
+++ b/web/document_attachments_view.js
@@ -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);
}
};
diff --git a/web/viewer.css b/web/viewer.css
index 61c7b57..7f87e8b 100644
--- a/web/viewer.css
+++ b/web/viewer.css
@@ -1178,13 +1178,19 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
width: 192px;
top: 0;
bottom: 0;
- padding: 4px 4px 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
-webkit-user-select: none;
-moz-user-select: none;
}
+#outlineView {
+ padding: 4px 4px 0;
+}
+#attachmentsView {
+ padding: 3px 4px 0;
+}
+
html[dir='ltr'] .outlineItem > .outlineItems {
margin-left: 20px;
}
@@ -1194,7 +1200,7 @@ html[dir='rtl'] .outlineItem > .outlineItems {
}
.outlineItem > a,
-.attachmentsItem > a {
+.attachmentsItem > button {
text-decoration: none;
display: inline-block;
min-width: 95%;
@@ -1208,18 +1214,31 @@ html[dir='rtl'] .outlineItem > .outlineItems {
white-space: normal;
}
-html[dir='ltr'] .outlineItem > a,
-html[dir='ltr'] .attachmentsItem > a {
+.attachmentsItem > button {
+ border: 0 none;
+ background: none;
+ cursor: pointer;
+ width: 100%;
+}
+
+html[dir='ltr'] .outlineItem > a {
padding: 2px 0 5px 10px;
}
+html[dir='ltr'] .attachmentsItem > button {
+ padding: 2px 0 3px 7px;
+ text-align: left;
+}
-html[dir='rtl'] .outlineItem > a,
-html[dir='rtl'] .attachmentsItem > a {
+html[dir='rtl'] .outlineItem > a {
padding: 2px 10px 5px 0;
}
+html[dir='rtl'] .attachmentsItem > button {
+ padding: 2px 7px 3px 0;
+ text-align: right;
+}
.outlineItem > a:hover,
-.attachmentsItem > a:hover {
+.attachmentsItem > button:hover {
background-color: hsla(0,0%,100%,.02);
background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
background-clip: padding-box;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list