mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 21:30:39 +00:00
optimize win scrollbar style
This commit is contained in:
16
media/js/init-scroll-bar.js
Normal file
16
media/js/init-scroll-bar.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
var agent = navigator && navigator.userAgent;
|
||||||
|
var lowCaseAgent = agent && agent.toLocaleLowerCase()
|
||||||
|
var isWin = lowCaseAgent && (
|
||||||
|
(lowCaseAgent.indexOf('win32') > -1 || lowCaseAgent.indexOf('wow32') > -1) ||
|
||||||
|
(lowCaseAgent.indexOf('win64') > -1 || lowCaseAgent.indexOf('wow64') > -1)
|
||||||
|
)
|
||||||
|
|
||||||
|
if (isWin) {
|
||||||
|
var style = document.createElement('style');
|
||||||
|
document.head.appendChild(style);
|
||||||
|
var sheet = style.sheet;
|
||||||
|
sheet.insertRule('div::-webkit-scrollbar { width: 8px;height: 8px; }');
|
||||||
|
sheet.insertRule('div::-webkit-scrollbar-button { display: none; }');
|
||||||
|
sheet.insertRule('div::-webkit-scrollbar-thumb { background-color: rgb(206, 206, 212);border-radius: 10px; }');
|
||||||
|
sheet.insertRule('div.vertical-scrollbar::-webkit-scrollbar-thumb { min-height: 40px }');
|
||||||
|
}
|
@@ -17,5 +17,6 @@ seadocServerUrl: '{{ seadoc_server_url }}',
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block render_bundle %}
|
{% block render_bundle %}
|
||||||
|
<script src="{{ MEDIA_URL }}js/init-scroll-bar.js" ></script>
|
||||||
{% render_bundle 'viewFileSdoc' 'js' %}
|
{% render_bundle 'viewFileSdoc' 'js' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user