mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 12:07:10 -04:00
Add maxIconSize option.
This commit is contained in:
parent
9eb29b5707
commit
fe9c7587d8
3 changed files with 6 additions and 6 deletions
|
@ -25,6 +25,7 @@ Options
|
|||
- hideFolders: boolean, hide all folders in the main view
|
||||
- hideIf403: boolean, hide files and folders that are not readable by the server
|
||||
- hideParentFolder: boolean, hide parent folder links in the main view
|
||||
- maxIconSize: number, max size for icons in the main view
|
||||
- modes: array of strings, subset of ["details", "grid", "icons"]
|
||||
the first value indicates the default view mode. If only one value
|
||||
is given the view mode is fixed and the selector buttons are hidden.
|
||||
|
@ -48,10 +49,11 @@ Options
|
|||
"hideFolders": false,
|
||||
"hideIf403": true,
|
||||
"hideParentFolder": false,
|
||||
"maxIconSize": 40,
|
||||
"modes": ["details", "grid", "icons"],
|
||||
"modeToggle": false,
|
||||
"setParentFolderLabels": true,
|
||||
"sizes": [20, 40, 60, 80, 100, 150, 200, 250, 300, 350, 400],
|
||||
"sizes": [20, 40, 60, 80, 100, 140, 180, 220, 260, 300],
|
||||
"theme": "",
|
||||
"unmanaged": ["index.html", "index.htm", "index.php"],
|
||||
"unmanagedInNewWindow": false
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#view {
|
||||
@max-icon-size: 32px;
|
||||
|
||||
a, a:active, a:visited {
|
||||
display: block;
|
||||
|
@ -41,8 +40,6 @@
|
|||
text-align: center;
|
||||
|
||||
img {
|
||||
max-width: @max-icon-size;
|
||||
max-height: @max-icon-size;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
|
|
|
@ -48,8 +48,8 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat
|
|||
function createStyles(size) {
|
||||
|
||||
var dsize = cropSize(size, 20, 80);
|
||||
var gsize = cropSize(size, 40, 150);
|
||||
var isize = cropSize(size, 80, 2000);
|
||||
var gsize = cropSize(size, 40, 160);
|
||||
var isize = cropSize(size, 80, 1000);
|
||||
var ilsize = Math.round(isize * 4 / 3);
|
||||
var rules = [
|
||||
'#view.view-details.view-size-' + size + ' .item .label { line-height: ' + (dsize + 14) + 'px !important; }',
|
||||
|
@ -75,6 +75,7 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat
|
|||
function addCssStyles() {
|
||||
|
||||
var styles = _.map(sortedSizes, function (size) { return createStyles(size); });
|
||||
styles.push('#view .icon img { max-width: ' + settings.maxIconSize + 'px; max-height: ' + settings.maxIconSize + 'px; }');
|
||||
$('<style/>').text(styles.join('\n')).appendTo('head');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue