A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
hide tooltip on applying a format
ammarahm-ed61c71bce7cb4
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js b/apps/mobile/src/views/Editor/tiny/toolbar/constants.jsindex 4190bac3c..f3c06a1d7 100644--- a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js+++ b/apps/mobile/src/views/Editor/tiny/toolbar/constants.js@@ -1,4 +1,5 @@import {Platform} from 'react-native';+import { eSendEvent } from '../../../../services/EventManager';import {EditorWebView} from '../../Functions';import tiny from '../tiny';@@ -14,6 +15,8 @@ export function formatSelection(command) {}export function focusEditor(format) {++ eSendEvent("showTooltip");Platform.OS === 'android' && EditorWebView.current.requestFocus();if (format === 'link' || format === 'video') {tiny.call(EditorWebView, tiny.blur + ' ' + tiny.focusEditor);@@ -162,4 +165,5 @@ export const TOOLBAR_ICONS = {removeformat: 'format-clear',horizontal: 'border-horizontal',table: 'table-plus',+ settings:'cog-outline'};diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/item.js b/apps/mobile/src/views/Editor/tiny/toolbar/item.jsindex 0e83d501f..93bc538a0 100644--- a/apps/mobile/src/views/Editor/tiny/toolbar/item.js+++ b/apps/mobile/src/views/Editor/tiny/toolbar/item.js@@ -1,5 +1,5 @@import React, {useEffect, useState} from 'react';-import { Platform } from 'react-native';+import {Platform} from 'react-native';import {View} from 'react-native';import {TouchableOpacity} from 'react-native-gesture-handler';import Icon from 'react-native-vector-icons/MaterialCommunityIcons';@@ -188,6 +188,11 @@ const ToolbarItem = ({}return;} */+ if (type === 'settings') {+ eSendEvent('openEditorSettings');+ return;+ }+if (editing.tooltip === format && !formatValue) {focusEditor(format);eSendEvent('showTooltip');@@ -232,18 +237,16 @@ const ToolbarItem = ({groupFormat === 'ol' ||groupFormat === 'ul') {- if (groupFormat === "fontname" && formatValue === "") {- value = Platform.OS === "ios" ? "-apple-system" : "serif";+ if (groupFormat === 'fontname' && formatValue === '') {+ value = Platform.OS === 'ios' ? '-apple-system' : 'serif';} else {value = formatValue;}-}-if (selected && (format === 'ol' || format === 'ul' || format === 'cl')) {formatSelection(execCommands.removeList);- } else if (value || value === "") {+ } else if (value || value === '') {formatSelection(execCommands[format](value));} else {formatSelection(execCommands[format]);@@ -291,8 +294,7 @@ const ToolbarItem = ({<Paragraphsize={SIZE.md}color={selected ? colors.accent : colors.pri}>- {formatValue || currentText || "12pt"}-+ {formatValue || currentText || '12pt'}</Paragraph>) : text && groupFormat !== 'header' ? (<Paragraph@@ -300,15 +302,16 @@ const ToolbarItem = ({style={{paddingHorizontal: 12,fontFamily:- format === 'fontname' && formatValue && formatValue !== "-apple-system"+ format === 'fontname' &&+ formatValue &&+ formatValue !== '-apple-system'? formatValue- : format === 'fontname' && icon !== "-apple-system" && icon+ : format === 'fontname' && icon !== '-apple-system' && icon? icon: null,}}size={SIZE.md}>{currentText || text}-</Paragraph>) : (<Icon