diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index ac857250..1f8e3b90 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -18,6 +18,9 @@ import _ from 'lodash' import { findNoteTitle } from 'browser/lib/findNoteTitle' import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig' import TrashButton from './TrashButton' +import InfoButton from './InfoButton' +import InfoPanel from './InfoPanel' +import { formatDate } from 'browser/lib/date-formatter' function pass (name) { switch (name) { @@ -54,7 +57,7 @@ class SnippetNoteDetail extends React.Component { } componentWillReceiveProps (nextProps) { - if (nextProps.note.key !== this.props.note.key) { + if (nextProps.note.key !== this.props.note.key && !this.isMovingNote) { if (this.saveQueue != null) this.saveNow() let nextNote = Object.assign({ description: '' @@ -433,10 +436,18 @@ class SnippetNoteDetail extends React.Component { this.refs['code-' + this.state.snippetIndex].focus() } + handleInfoButtonClick (e) { + const infoPanel = document.querySelector('.infoPanel') + if (infoPanel.style) infoPanel.style.display = infoPanel.style.display === 'none' ? 'inline' : 'none' + } + render () { - let { data, config } = this.props + let { data, config, location } = this.props let { note } = this.state + let storageKey = note.storage + let folderKey = note.folder + let editorFontSize = parseInt(config.editor.fontSize, 10) if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 let editorIndentSize = parseInt(config.editor.indentSize, 10) @@ -491,6 +502,17 @@ class SnippetNoteDetail extends React.Component { }) + let options = [] + data.storageMap.forEach((storage, index) => { + storage.folders.forEach((folder) => { + options.push({ + storage: storage, + folder: folder + }) + }) + }) + let currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0] + return (
+ this.handleInfoButtonClick(e)} + /> +