Skip to content

Commit

Permalink
Fix 2636 (#3206)
Browse files Browse the repository at this point in the history
* Fix 2636 Can't scroll to bottom of editor pane

* Fix minor lint issues
  • Loading branch information
hsiehjack authored and Rokt33r committed Aug 11, 2019
1 parent 606be43 commit f09297f
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"globals": {
"FileReader": true,
"localStorage": true,
"fetch": true
"fetch": true,
"Image": true,
"MutationObserver": true
},
"env": {
"jest": true
Expand Down
2 changes: 1 addition & 1 deletion browser/components/MarkdownPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const CSS_FILES = [
`${appPath}/node_modules/codemirror/lib/codemirror.css`,
`${appPath}/node_modules/react-image-carousel/lib/css/main.min.css`
]
const win = global.process.platform === 'win32'

function buildStyle (
fontFamily,
Expand Down Expand Up @@ -815,6 +814,7 @@ export default class MarkdownPreview extends React.Component {
canvas.height = height.value + 'vh'
}

// eslint-disable-next-line no-unused-vars
const chart = new Chart(canvas, chartConfig)
} catch (e) {
el.className = 'chart-error'
Expand Down
4 changes: 2 additions & 2 deletions browser/components/NoteItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import PropTypes from 'prop-types'
import React from 'react'
import { isArray } from 'lodash'
import { isArray, sortBy } from 'lodash'
import invertColor from 'invert-color'
import CSSModules from 'browser/lib/CSSModules'
import { getTodoStatus } from 'browser/lib/getTodoStatus'
Expand Down Expand Up @@ -43,7 +43,7 @@ const TagElementList = (tags, showTagsAlphabetically, coloredTags) => {
}

if (showTagsAlphabetically) {
return _.sortBy(tags).map(tag => TagElement({ tagName: tag, color: coloredTags[tag] }))
return sortBy(tags).map(tag => TagElement({ tagName: tag, color: coloredTags[tag] }))
} else {
return tags.map(tag => TagElement({ tagName: tag, color: coloredTags[tag] }))
}
Expand Down
1 change: 0 additions & 1 deletion browser/lib/keygen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const crypto = require('crypto')
const _ = require('lodash')
const uuidv4 = require('uuid/v4')

module.exports = function (uuid) {
Expand Down
1 change: 0 additions & 1 deletion browser/main/Detail/MarkdownNoteDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class MarkdownNoteDetail extends React.Component {
}

handleFolderChange (e) {
const { dispatch } = this.props
const { note } = this.state
const value = this.refs.folder.value
const splitted = value.split('-')
Expand Down
1 change: 1 addition & 0 deletions browser/main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class Main extends React.Component {
}
})

// eslint-disable-next-line no-undef
delete CodeMirror.keyMap.emacs['Ctrl-V']

eventEmitter.on('editor:fullscreen', this.toggleFullScreen)
Expand Down
7 changes: 4 additions & 3 deletions browser/main/SideNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import context from 'browser/lib/context'
import { remote } from 'electron'
import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
import ColorPicker from 'browser/components/ColorPicker'
import { every, sortBy } from 'lodash'

function matchActiveTags (tags, activeTags) {
return _.every(activeTags, v => tags.indexOf(v) >= 0)
return every(activeTags, v => tags.indexOf(v) >= 0)
}

class SideNav extends React.Component {
Expand Down Expand Up @@ -283,7 +284,7 @@ class SideNav extends React.Component {
const { colorPicker } = this.state
const activeTags = this.getActiveTags(location.pathname)
const relatedTags = this.getRelatedTags(activeTags, data.noteMap)
let tagList = _.sortBy(data.tagNoteMap.map(
let tagList = sortBy(data.tagNoteMap.map(
(tag, name) => ({ name, size: tag.size, related: relatedTags.has(name) })
).filter(
tag => tag.size > 0
Expand All @@ -296,7 +297,7 @@ class SideNav extends React.Component {
})
}
if (config.sortTagsBy === 'COUNTER') {
tagList = _.sortBy(tagList, item => (0 - item.size))
tagList = sortBy(tagList, item => (0 - item.size))
}
if (config.ui.showOnlyRelatedTags && (relatedTags.size > 0)) {
tagList = tagList.filter(
Expand Down
3 changes: 2 additions & 1 deletion browser/main/lib/dataApi/attachmentManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const escapeStringRegexp = require('escape-string-regexp')
const sander = require('sander')
const url = require('url')
import i18n from 'browser/lib/i18n'
import { isString } from 'lodash'

const STORAGE_FOLDER_PLACEHOLDER = ':storage'
const DESTINATION_FOLDER = 'attachments'
Expand All @@ -19,7 +20,7 @@ const PATH_SEPARATORS = escapeStringRegexp(path.posix.sep) + escapeStringRegexp(
* @returns {Promise<Image>} Image element created
*/
function getImage (file) {
if (_.isString(file)) {
if (isString(file)) {
return new Promise(resolve => {
const img = new Image()
img.onload = () => resolve(img)
Expand Down
1 change: 0 additions & 1 deletion browser/main/lib/dataApi/deleteFolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const path = require('path')
const resolveStorageData = require('./resolveStorageData')
const resolveStorageNotes = require('./resolveStorageNotes')
const CSON = require('@rokt33r/season')
const sander = require('sander')
const { findStorage } = require('browser/lib/findStorage')
const deleteSingleNote = require('./deleteNote')

Expand Down
1 change: 0 additions & 1 deletion browser/main/lib/dataApi/moveNote.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const resolveStorageData = require('./resolveStorageData')
const _ = require('lodash')
const path = require('path')
const fs = require('fs')
const CSON = require('@rokt33r/season')
const keygen = require('browser/lib/keygen')
const sander = require('sander')
Expand Down
1 change: 0 additions & 1 deletion browser/main/modals/PreferencesModal/UiTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { getLanguages } from 'browser/lib/Languages'
import normalizeEditorFontFamily from 'browser/lib/normalizeEditorFontFamily'

const OSX = global.process.platform === 'darwin'
const WIN = global.process.platform === 'win32'

const electron = require('electron')
const ipc = electron.ipcRenderer
Expand Down
5 changes: 5 additions & 0 deletions lib/main.development.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
border-left-color: rgba(142, 142, 142, 0.5);
mix-blend-mode: difference;
}

.CodeMirror-scroll {
margin-bottom: 0;
padding-bottom: 0;
}

.CodeMirror-lint-tooltip {
z-index: 1003;
Expand Down
5 changes: 5 additions & 0 deletions lib/main.production.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
border-left-color: rgba(142, 142, 142, 0.5);
mix-blend-mode: difference;
}

.CodeMirror-scroll {
margin-bottom: 0;
padding-bottom: 0;
}
</style>
</head>

Expand Down

0 comments on commit f09297f

Please sign in to comment.