mirror of
https://github.com/writeas/writefreely
synced 2025-02-01 01:56:58 +01:00
Merge pull request #452 from writefreely/fix-ace-touchscreens
Disable Ace editor on touchscreen devices
This commit is contained in:
commit
c0fdd8af49
@ -12,6 +12,12 @@ textarea.section.norm {
|
|||||||
max-height: 20em;
|
max-height: 20em;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
}
|
}
|
||||||
|
@media (pointer: coarse) {
|
||||||
|
.codable {
|
||||||
|
font-size: 0.75em !important;
|
||||||
|
height: 17em !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="content-container snug">
|
<div class="content-container snug">
|
||||||
@ -258,6 +264,8 @@ var $customDomain = document.getElementById('domain-alias');
|
|||||||
var $customHandleEnv = document.getElementById('custom-handle-env');
|
var $customHandleEnv = document.getElementById('custom-handle-env');
|
||||||
var $normalHandleEnv = document.getElementById('normal-handle-env');
|
var $normalHandleEnv = document.getElementById('normal-handle-env');
|
||||||
|
|
||||||
|
if (matchMedia('(pointer:fine)').matches) {
|
||||||
|
// Only initialize Ace editor on devices with a mouse
|
||||||
var opt = {
|
var opt = {
|
||||||
showLineNumbers: false,
|
showLineNumbers: false,
|
||||||
showPrintMargin: 0,
|
showPrintMargin: 0,
|
||||||
@ -270,6 +278,7 @@ cssEditor.setTheme(theme);
|
|||||||
cssEditor.session.setMode("ace/mode/css");
|
cssEditor.session.setMode("ace/mode/css");
|
||||||
cssEditor.setOptions(opt);
|
cssEditor.setOptions(opt);
|
||||||
cssEditor.resize(true);
|
cssEditor.resize(true);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{template "footer" .}}
|
{{template "footer" .}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user