fix titlebar on android editor

This commit is contained in:
ammarahm-ed
2020-12-20 10:09:38 +05:00
parent 757cf73053
commit 5de6004c1f
6 changed files with 34 additions and 34 deletions

View File

@@ -265,7 +265,6 @@ const setTheme = function () {
}
.ql-snow.ql-toolbar button,
.ql-snow .ql-toolbar button {
height: ${pageTheme.colors.factor * 32};
width: ${pageTheme.colors.factor * 36};
}
@@ -290,18 +289,12 @@ const setTheme = function () {
#titleInput {
color:${pageTheme.colors.heading};
font-size:${32 * 1.5 * pageTheme.colors.factor};
}
#titlebar {
background-color:${pageTheme.colors.shade};
font-size:${32 * pageTheme.colors.factor};
}
#textCopy {
color:${pageTheme.colors.pri};
font-size:${32 * 1.5 * pageTheme.colors.factor};
font-size:${32 * pageTheme.colors.factor};
}
#titleInput::-webkit-input-placeholder {
color:${pageTheme.colors.icon}
@@ -354,10 +347,6 @@ const setTheme = function () {
height:50px;
color:${pageTheme.colors.heading}
}
.info-bar {
margin-bottom:${isTablet ? '12px !important' : '0px !important'};
padding-left:12px;
}
#titlebarAlt {
height:50px;
@@ -373,11 +362,7 @@ const setTheme = function () {
font-family: 'Poppins', sans-serif;
margin: 0px;
position: relative;
height:${
isTablet
? 'calc(100% - 260px) !important'
: 'calc(100% - 110px) !important'
};
height:calc(100% - 115px) !important
}

View File

@@ -72,21 +72,32 @@ function onTitleChange(ele) {
function autosize() {
if (isTablet) {
document.getElementById('textCopy').innerHTML = document
let ele = document.getElementById('textCopy');
ele.innerHTML = document
.getElementById(titleInput)
.value.replace(/\n/g, '<br/>');
console.log(document.getElementById('titlebar').scrollHeight);
let newHeight = document.getElementById('titlebar').scrollHeight;
let css = document.createElement('style');
css.type = 'text/css';
let node = `
.ql-container {
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
margin: 0px;
position: relative;
height:calc(100% - ${newHeight + 65}px) !important
};
`;
css.appendChild(document.createTextNode(node));
document.getElementsByTagName('head')[0].appendChild(css);
}
}
function attachEditorListeners() {
/* editor.once('text-change', function () {
window.ReactNativeWebView.postMessage('loaded');
}); */
titleInput = isTablet ? 'titleInput' : 'simpleTitleInput';
infoBar = isTablet ? '.info-bar' : '.info-bar-alt';
function isWhitespace(ch) {
let whiteSpace = false;
if (ch === ' ' || ch === '\t' || ch === '\n') {

View File

@@ -34,6 +34,7 @@
outline: none;
overflow-y: hidden;
padding: 12px 12px;
padding-top: 0px;
tab-size: 4;
-moz-tab-size: 4;
text-align: left;
@@ -1083,6 +1084,7 @@
border: none;
width: 100%;
outline: none;
resize: none;
}
#formBox {
@@ -1094,7 +1096,7 @@
background-color: transparent;
padding-left: 12px;
padding-right: 12px;
min-height: 195px;
min-height: 45px;
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -1119,7 +1121,7 @@
#formBox > div {
visibility: hidden;
min-height: 60px;
min-height: 45px;
}
.info-bar {
@@ -1129,7 +1131,8 @@
height: 20px;
font-family: 'Poppins';
margin-top: -8px;
margin-bottom: 12px;
margin-bottom: 6px ;
padding-left: 0px !important;
}
#titlebar textarea:focus {

View File

@@ -53,7 +53,7 @@
</body>
<script>
let editor;
let isTablet = false;
let isTablet = true;
</script>
<script src="quill.js"></script>
<script src="constants.js"></script>
@@ -442,8 +442,8 @@
},
};
attachMessageListener();
function loadAction(premium, tab) {
isTablet = tab;
function loadAction(premium) {
isTablet = true;
setFonts();
Quill.register("modules/imageCompressor", imageCompressor);
Quill.register("formats/lists", BetterList);
@@ -530,6 +530,7 @@
}
}
loadAction(true)
</script>

View File

@@ -290,7 +290,6 @@ const setTheme = function () {
#textCopy {
color:${pageTheme.colors.pri};
font-size:${32 * pageTheme.colors.factor};
min-height: ${32 * pageTheme.colors.factor + 6};
}
@@ -349,7 +348,6 @@ const setTheme = function () {
color:${pageTheme.colors.heading}
}
.info-bar {
margin-bottom:${isTablet ? '12px !important' : '0px !important'};
padding-left:12px;
}

View File

@@ -1093,6 +1093,7 @@
border: none;
width: 100%;
outline: none;
resize: none;
}
#formBox {
@@ -1104,7 +1105,7 @@
background-color: transparent;
padding-left: 12px;
padding-right: 12px;
min-height: 60px;
min-height: 45px;
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -1135,6 +1136,7 @@
#formBox > div {
visibility: hidden;
min-height: 45px;
}
.info-bar {
@@ -1144,7 +1146,7 @@
height: 20px;
font-family: 'Poppins';
margin-top: -8px;
margin-bottom: 12px;
margin-bottom: 6px;
}
#titlebar textarea:focus {
outline: none;