Merge pull request #1179 from gigaherz/sidebar-pinning
Implement sidebar pinning
This commit is contained in:
commit
27b9ae79ee
@ -65,6 +65,7 @@ MIMEs = {
|
|||||||
'.pdf': 'application/pdf',
|
'.pdf': 'application/pdf',
|
||||||
'.xhtml': 'application/xhtml+xml',
|
'.xhtml': 'application/xhtml+xml',
|
||||||
'.ico': 'image/x-icon',
|
'.ico': 'image/x-icon',
|
||||||
|
'.png': 'image/png',
|
||||||
'.log': 'text/plain'
|
'.log': 'text/plain'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
web/images/pin_down.png
Normal file
BIN
web/images/pin_down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
web/images/pin_up.png
Normal file
BIN
web/images/pin_up.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
@ -89,7 +89,8 @@ span#info {
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar:hover {
|
#sidebar:hover,
|
||||||
|
#sidebar.pinned {
|
||||||
left: 0px;
|
left: 0px;
|
||||||
transition: left 0.25s ease-in-out 0s;
|
transition: left 0.25s ease-in-out 0s;
|
||||||
-o-transition: left 0.25s ease-in-out 0s;
|
-o-transition: left 0.25s ease-in-out 0s;
|
||||||
@ -97,6 +98,24 @@ span#info {
|
|||||||
-webkit-transition: left 0.25s ease-in-out 0s;
|
-webkit-transition: left 0.25s ease-in-out 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pinIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 55px;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
background: center no-repeat;
|
||||||
|
background-image: url('images/pin_up.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
#pinIcon:hover {
|
||||||
|
background-color: rgba(255,255,255,0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar.pinned #pinIcon {
|
||||||
|
background-image: url('images/pin_down.png');
|
||||||
|
}
|
||||||
|
|
||||||
#sidebarBox {
|
#sidebarBox {
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
width: 300px;
|
width: 300px;
|
||||||
@ -116,7 +135,7 @@ span#info {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
top: 10px;
|
top: 20px;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
@ -147,7 +166,7 @@ span#info {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
top: 10px;
|
top: 20px;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
@ -381,6 +400,6 @@ canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#loading {
|
#loading {
|
||||||
margin: 100px 0;
|
margin: 100px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@
|
|||||||
|
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
<div id="sidebarBox">
|
<div id="sidebarBox">
|
||||||
|
<div id="pinIcon" onClick="PDFView.pinSidebar()"></div>
|
||||||
<div id="sidebarScrollView">
|
<div id="sidebarScrollView">
|
||||||
<div id="sidebarView"></div>
|
<div id="sidebarView"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -136,7 +137,7 @@
|
|||||||
<img src="images/nav-outline.svg" align="top" height="16" alt="Document Outline" />
|
<img src="images/nav-outline.svg" align="top" height="16" alt="Document Outline" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="loading">Loading... 0%</div>
|
<div id="loading">Loading... 0%</div>
|
||||||
|
@ -571,6 +571,10 @@ var PDFView = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pinSidebar: function pdfViewPinSidebar() {
|
||||||
|
document.getElementById('sidebar').classList.toggle('pinned');
|
||||||
|
},
|
||||||
|
|
||||||
getVisiblePages: function pdfViewGetVisiblePages() {
|
getVisiblePages: function pdfViewGetVisiblePages() {
|
||||||
var pages = this.pages;
|
var pages = this.pages;
|
||||||
var kBottomMargin = 10;
|
var kBottomMargin = 10;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user