mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-14 03:09:46 +00:00
Apply custom style only if Include Style is set
This commit is contained in:
parent
22ddc6e918
commit
0a8748220a
2 changed files with 12 additions and 2 deletions
|
@ -89,6 +89,9 @@
|
|||
padding: 7px 0;
|
||||
background-color: white;
|
||||
}
|
||||
#styleLabel:disabled {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
#allStylesList {
|
||||
display: inline-block;
|
||||
|
@ -123,7 +126,7 @@
|
|||
<div class="menu-holder">
|
||||
<div id="menuTitle">Save as eBook:</div>
|
||||
<hr/>
|
||||
<div id="includeStyle"><input type="checkbox" name="button" id="includeStyleCheck"></input>Include Style<span style="float:right;background-color:black;color:white;font-size:10px;padding:2px 10px;"><sup><b>TESTING</b></sup></span></div>
|
||||
<div id="includeStyle"><input type="checkbox" name="button" id="includeStyleCheck"></input>Include Style</div>
|
||||
<div id="styleLabel">Custom Style:</div>
|
||||
<div>
|
||||
<select id="allStylesList"></select>
|
||||
|
|
|
@ -51,7 +51,6 @@ function createStyleList(styles) {
|
|||
|
||||
if (allMatchingStyles.length >= 1) {
|
||||
allMatchingStyles.sort(function (a, b) {
|
||||
console.log(a.length, b.length);
|
||||
return b.length - a.length;
|
||||
});
|
||||
var selStyle = allMatchingStyles[0];
|
||||
|
@ -66,6 +65,10 @@ function createStyleList(styles) {
|
|||
function createIncludeStyle(data) {
|
||||
var includeStyleCheck = document.getElementById('includeStyleCheck');
|
||||
includeStyleCheck.checked = data;
|
||||
document.getElementById('styleLabel').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('allStylesList').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('applyStyle').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('editStyles').disabled = !includeStyleCheck.checked;
|
||||
}
|
||||
|
||||
getIncludeStyle(createIncludeStyle);
|
||||
|
@ -73,6 +76,10 @@ getIncludeStyle(createIncludeStyle);
|
|||
document.getElementById('includeStyleCheck').onclick = function () {
|
||||
var includeStyleCheck = document.getElementById('includeStyleCheck');
|
||||
setIncludeStyle(includeStyleCheck.checked);
|
||||
document.getElementById('styleLabel').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('allStylesList').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('applyStyle').disabled = !includeStyleCheck.checked;
|
||||
document.getElementById('editStyles').disabled = !includeStyleCheck.checked;
|
||||
}
|
||||
|
||||
document.getElementById('allStylesList').onchange = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue