home tab activation

t Please enter the commit message for your changes. Lines starting
pull/1/head
LianaHus 6 years ago
parent b0a3f7545f
commit 086db97fcb
  1. 19
      src/app/components/vertical-icons.js
  2. 7
      src/app/ui/landing-page/landing-page.js
  3. 2
      src/framingService.js

@ -196,9 +196,17 @@ export class VerticalIcons {
* @param {string} name Name of profile of the module to activate * @param {string} name Name of profile of the module to activate
*/ */
select (name) { select (name) {
this.updateActivations(name)
this.events.emit('showContent', name)
}
updateActivations(name) {
if (name === "home") {
this.activateHome()
} else {
this.removeActive() this.removeActive()
this.addActive(name) this.addActive(name)
this.events.emit('showContent', name) }
} }
onThemeChanged (themeType) { onThemeChanged (themeType) {
@ -211,17 +219,20 @@ export class VerticalIcons {
} }
_iconClick (name) { _iconClick (name) {
this.removeActive() this.updateActivations(name)
this.addActive(name)
this.events.emit('toggleContent', name) this.events.emit('toggleContent', name)
} }
activateHome() {
globalRegistry.get('appmanager').api.ensureActivated('home')
}
render () { render () {
let home = yo` let home = yo`
<div <div
class="${css.homeIcon}" class="${css.homeIcon}"
onclick="${(e) => { onclick="${(e) => {
globalRegistry.get('appmanager').api.ensureActivated('home') this.activateHome()
}}" }}"
plugin="${this.homeProfile.name}" title="${this.homeProfile.displayName}" plugin="${this.homeProfile.name}" title="${this.homeProfile.displayName}"
> >

@ -96,9 +96,12 @@ export class LandingPage extends BaseApi {
let load = function (service, item, examples, info) { let load = function (service, item, examples, info) {
let compilerImport = new CompilerImport() let compilerImport = new CompilerImport()
let fileProviders = globalRegistry.get('fileproviders').api let fileProviders = globalRegistry.get('fileproviders').api
const msg = yo`<div class="p-2"><span>Enter the ${item} you would like to load.</span> const msg = yo`
<div class="p-2">
<span>Enter the ${item} you would like to load.</span>
<div>${info}</div> <div>${info}</div>
<div>e.g ${examples.map((url) => { return yo`<div class="p-1"><a>${url}</a></div>` })}</div></div>` <div>e.g ${examples.map((url) => { return yo`<div class="p-1"><a>${url}</a></div>` })}</div>
</div>`
modalDialogCustom.prompt(`Import from ${service}`, msg, null, (target) => { modalDialogCustom.prompt(`Import from ${service}`, msg, null, (target) => {
if (target !== '') { if (target !== '') {

@ -11,7 +11,7 @@ export default {
}) })
verticalIcon.select('fileExplorers') verticalIcon.select('fileExplorers')
mainPanel.showContent('home') verticalIcon.select('home')
document.addEventListener('keypress', (e) => { document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) { if (e.shiftKey && e.ctrlKey) {

Loading…
Cancel
Save