Skip to content

Commit 541fdbe

Browse files
authored
Merge pull request #3 from solid/dom-to-context
Making use of the new context object
2 parents 707f02e + f57020b commit 541fdbe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sourcePane.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
const UI = require('solid-ui')
99
const mime = require('mime-types')
10-
const kb = UI.store
1110

1211
module.exports = {
1312
icon: UI.icons.iconBase + 'noun_109873.svg', // noun_109873_51A7F9.svg
1413

1514
name: 'source',
1615

17-
label: function (subject) {
16+
label: function (subject, context) {
17+
var kb = context.session.store
1818
var typeURIs = kb.findTypeURIs(subject)
1919
var prefix = $rdf.Util.mediaTypeClass('text/*').uri.split('*')[0]
2020
for (var t in typeURIs) {
@@ -25,7 +25,8 @@ module.exports = {
2525
},
2626

2727
// Create a new text file in a Solid system,
28-
mintNew: function (newPaneOptions) {
28+
mintNew: function (context, newPaneOptions) {
29+
var kb = context.session.store
2930
var newInstance = newPaneOptions.newInstance
3031
if (!newInstance) {
3132
let uri = newPaneOptions.newBase
@@ -68,8 +69,9 @@ module.exports = {
6869
})
6970
},
7071

71-
render: function (subject, dom) {
72-
const kb = UI.store
72+
render: function (subject, context) {
73+
const dom = context.dom
74+
const kb = context.session.store
7375
const fetcher = kb.fetcher
7476
const editStyle =
7577
'font-family: monospace; font-size: 100%; min-width:60em; margin: 1em 0.2em 1em 0.2em; padding: 1em; border: 0.1em solid #888; border-radius: 0.5em;'

0 commit comments

Comments
 (0)