How to use the mithril.render function in mithril

To help you get started, we’ve selected a few mithril examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sueddeutsche / editron / editors / AbstractValueEditor.js View on Github external
render() {
        // this.$element.innerHTML = "<b>Overwrite AbstractValueEditor.render() to generate your view</b>";
        m.render(this.$element, m("b", "Overwrite AbstractValueEditor.render() to generate view"));
    }
github sueddeutsche / editron / services / OverlayService.js View on Github external
close() {
        UIState.setOverlay();
        // must destroy component for reuse
        m.render(this.getElement(), m("i"));
    },
github ArthurClemens / mithril-starter-rollup / tools / testing.js View on Github external
export const render = (component) => {
    const root = document.createElement('div');
    m.render(root, component);
    return root;
};
github ornicar / chessground / src / main.js View on Github external
function init(element, config) {

  var controller = new ctrl(config);

  m.render(element, view(controller));

  return api(controller);
}
github Happy0 / ssb-chess / ui / game / promote.js View on Github external
const cb = (piece) => {
      c.removeChild(prom);
      onChoice(piece);
    };

    const box = PromotionBox(cb);

    const left = colour === 'white' ? 75 * columnLetterToNumberFromZero(column) : ((75 * 7) - (75 * columnLetterToNumberFromZero(column)));
    const promotionBox = m('div', {
      style: `z-index: 100; position: absolute; left: ${left}px; top: 0px;`,
    }, m(box));

    c.appendChild(prom);

    m.render(prom, promotionBox);
  }
github sueddeutsche / editron / editors / valueeditor / index.js View on Github external
render() {
        m.render(this.$element, m(View, this.viewModel));
    }
}
github spacejack / panel-slider / example-mithril / src / render.ts View on Github external
export function renderOutro (dom: HTMLElement) {
	m.render(dom, m('.intro.center',
		m('h2', 'Panel-Slider'),
		m('.lg-lt', {style: 'transform: rotate(180deg)'}, '➔'),
		m('p', 'Swipe left or right to navigate.'),
		m('p',
			'© 2019 by Mike Linkovich | ',
			m('a', {href: 'https://github.com/spacejack'}, 'Github')
		)
	))
}
github sueddeutsche / editron / editors / arrayeditor / ArrayItemEditor.js View on Github external
render() {
        m.render(this.$element, m(ArrayItemView, this.viewModel));
    }
github hyperledger / sawtooth-core / families / track_and_trade / client / src / components / forms.js View on Github external
const triggerDownload = (name, ...contents) => {
  const file = new window.Blob(contents, {type: 'text/plain'})
  const href = window.URL.createObjectURL(file)
  const container = document.getElementById('download-container')
  m.render(container, m('a#downloader', { href, download: name }))
  document.getElementById('downloader').click()
  m.mount(container, null)
}