basic infrastructure for "relation map" note type

This commit is contained in:
azivner
2018-10-18 11:25:33 +02:00
parent 04af8a3a96
commit e487dc1df7
5 changed files with 35 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ import noteDetailText from './note_detail_text.js';
import noteDetailFile from './note_detail_file.js';
import noteDetailSearch from './note_detail_search.js';
import noteDetailRender from './note_detail_render.js';
import noteDetailRelationMap from './note_detail_relation_map.js';
import bundleService from "./bundle.js";
import noteAutocompleteService from "./note_autocomplete.js";
@@ -45,7 +46,8 @@ const components = {
'text': noteDetailText,
'file': noteDetailFile,
'search': noteDetailSearch,
'render': noteDetailRender
'render': noteDetailRender,
'relation-map': noteDetailRelationMap
};
function getComponent(type) {

View File

@@ -0,0 +1,15 @@
import server from "./server.js";
import noteDetailService from "./note_detail.js";
const $noteDetailRelationMap = $("#note-detail-relation-map");
async function render() {
$noteDetailRelationMap.show();
}
export default {
show: render,
getContent: () => "",
focus: () => null,
onNoteChange: () => null
}

View File

@@ -77,6 +77,9 @@ function NoteTypeModel() {
else if (type === 'file') {
return 'File';
}
else if (type === 'relation-map') {
return 'Relation Map';
}
else if (type === 'search') {
// ignore and do nothing, "type" will be hidden since it's not possible to switch to and from search
}
@@ -118,6 +121,13 @@ function NoteTypeModel() {
save();
};
this.selectRelationMap = function() {
self.type('relation-map');
self.mime('application/json');
save();
};
this.selectCode = function() {
self.type('code');
self.mime('');