gars_v2
Version:
Geo Assistant Research System
36 lines (29 loc) • 972 B
JavaScript
import Nav from './nav';
import Content from './content';
import { remote } from 'electron'; // native electron module
import error from '../helpers/error';
var state = remote.getGlobal('state');
class Finder {
constructor($container) {
var $view = $('<div>').addClass('view').appendTo($container);
var nav = new Nav($view);
var content = new Content($view);
nav.onnavigate = content.onnavigate = this.navigate.bind(this);
content.onopen = filepath => this.onopen(filepath);
this.nav = nav;
this.content = content;
this.$view = $view;
}
navigate(filepath) {
console.log('navigating to', filepath);
try {
this.nav.cd(filepath);
this.content.cd(filepath);
state.set('path', filepath);
} catch (e) {
error('Navigation Error', e)
}
}
onopen() {}
}
export default Finder;