mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Changed setFit function to not have redundant ifs and a better comment explaining what it does.
This commit is contained in:
parent
db5e99b3f0
commit
6ddbe8d436
@ -307,18 +307,16 @@ const readerComponent = () => {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Changes how the view should fit to the screen or if it should use the image's real size
|
* Sets the image to not be restricted to the size of its container if it's not being scaled
|
||||||
*
|
*
|
||||||
* @param {string} fitType - ver, horz and real for fitting to height, width,
|
* @param {string} fitType - ver, horz and real for fitting to height, width,
|
||||||
* and showing real size, respectively
|
* and showing real size, respectively
|
||||||
*/
|
*/
|
||||||
setFit(fitType){
|
setFit(fitType){
|
||||||
if (fitType === 'vert'){
|
if (fitType === 'real'){
|
||||||
document.styleSheets[0].rules[21].style.maxWidth = '100%';
|
|
||||||
} else if(fitType === 'horz'){
|
|
||||||
document.styleSheets[0].rules[21].style.maxWidth = '100%';
|
|
||||||
} else if (fitType === 'real'){
|
|
||||||
document.styleSheets[0].rules[21].style.maxWidth = '';
|
document.styleSheets[0].rules[21].style.maxWidth = '';
|
||||||
|
} else {
|
||||||
|
document.styleSheets[0].rules[21].style.maxWidth = '100%';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user