Add the viewBookmark button to the secondary toolbar

This commit is contained in:
Jonas Jenwald 2013-09-27 11:44:45 +02:00
parent ea50c078b0
commit b148c9cb51
3 changed files with 29 additions and 12 deletions

View File

@ -387,6 +387,7 @@ html[dir='rtl'] .secondaryToolbar {
max-width: 200px;
max-height: 400px;
overflow-y: auto;
margin-bottom: -4px;
}
.doorHanger,
@ -881,20 +882,25 @@ html[dir="rtl"] .secondaryToolbarButton.print::before {
content: url(images/toolbarButton-download.png);
}
.toolbarButton.bookmark {
.toolbarButton.bookmark,
.secondaryToolbarButton.bookmark {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-top: 3px;
padding-top: 4px;
text-decoration: none;
}
.secondaryToolbarButton.bookmark {
padding-top: 5px;
}
#viewBookmark[href='#'] {
.bookmark[href='#'] {
opacity: .5;
pointer-events: none;
}
.toolbarButton.bookmark::before {
.toolbarButton.bookmark::before,
.secondaryToolbarButton.bookmark::before {
content: url(images/toolbarButton-bookmark.png);
}
@ -931,9 +937,11 @@ html[dir="rtl"] .secondaryToolbarButton {
padding-right: 24px;
text-align: right;
}
#secondaryToolbarButtonContainer :last-child {
margin-bottom: 0;
html[dir="ltr"] .secondaryToolbarButton.bookmark {
padding-left: 27px;
}
html[dir="rtl"] .secondaryToolbarButton.bookmark {
padding-right: 27px;
}
html[dir="ltr"] .secondaryToolbarButton > span {

View File

@ -135,21 +135,25 @@ limitations under the License.
<span data-l10n-id="download_label">Download</span>
</button>
<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>
<div class="horizontalToolbarSeparator visibleLargeView"></div>
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="22" data-l10n-id="first_page">
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="23" data-l10n-id="first_page">
<span data-l10n-id="first_page_label">Go to First Page</span>
</button>
<button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="23" data-l10n-id="last_page">
<button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="24" data-l10n-id="last_page">
<span data-l10n-id="last_page_label">Go to Last Page</span>
</button>
<div class="horizontalToolbarSeparator"></div>
<button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="24" data-l10n-id="page_rotate_cw">
<button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="25" data-l10n-id="page_rotate_cw">
<span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
</button>
<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="25" data-l10n-id="page_rotate_ccw">
<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="26" data-l10n-id="page_rotate_ccw">
<span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
</button>
</div>
@ -197,7 +201,9 @@ limitations under the License.
<span data-l10n-id="download_label">Download</span>
</button>
<!-- <div class="toolbarButtonSpacer"></div> -->
<a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark"><span data-l10n-id="bookmark_label">Current View</span></a>
<a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>
<div class="verticalToolbarSeparator hiddenSmallView"></div>

View File

@ -1909,6 +1909,7 @@ function updateViewarea() {
});
var href = PDFView.getAnchorUrl(pdfOpenParams);
document.getElementById('viewBookmark').href = href;
document.getElementById('secondaryViewBookmark').href = href;
// Update the current bookmark in the browsing history.
PDFHistory.updateCurrentBookmark(pdfOpenParams, pageNumber);
@ -1952,6 +1953,8 @@ window.addEventListener('change', function webViewerChange(evt) {
// URL does not reflect proper document location - hiding some icons.
document.getElementById('viewBookmark').setAttribute('hidden', 'true');
document.getElementById('secondaryViewBookmark').
setAttribute('hidden', 'true');
document.getElementById('download').setAttribute('hidden', 'true');
document.getElementById('secondaryDownload').setAttribute('hidden', 'true');
}, true);