Skip to content

Commit b711ecf

Browse files
committed
Drop global variable ui exposing
1 parent ba1bef0 commit b711ecf

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

public/js/extra.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ require('./lib/common/login')
1919
require('../vendor/md-toc')
2020
var Viz = require('viz.js')
2121

22+
import getUIElements from './lib/editor/ui-elements'
23+
const ui = getUIElements()
24+
2225
// auto update last change
2326
window.createtime = null
2427
window.lastchangetime = null
@@ -634,7 +637,7 @@ function generateCleanHTML (view) {
634637
}
635638

636639
export function exportToRawHTML (view) {
637-
const filename = `${renderFilename(window.ui.area.markdown)}.html`
640+
const filename = `${renderFilename(ui.area.markdown)}.html`
638641
const src = generateCleanHTML(view)
639642
$(src).find('a.anchor').remove()
640643
const html = src[0].outerHTML
@@ -646,8 +649,8 @@ export function exportToRawHTML (view) {
646649

647650
// extract markdown body to html and compile to template
648651
export function exportToHTML (view) {
649-
const title = renderTitle(window.ui.area.markdown)
650-
const filename = `${renderFilename(window.ui.area.markdown)}.html`
652+
const title = renderTitle(ui.area.markdown)
653+
const filename = `${renderFilename(ui.area.markdown)}.html`
651654
const src = generateCleanHTML(view)
652655
// generate toc
653656
const toc = $('#ui-toc').clone()

public/js/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,6 @@ defaultTextHeight = parseInt($('.CodeMirror').css('line-height'))
322322

323323
// initalize ui reference
324324
const ui = getUIElements()
325-
// FIXME: fix global ui element expose
326-
window.ui = ui
327325

328326
// page actions
329327
var opts = {

0 commit comments

Comments
 (0)