Supply DOM name to editor from the outside

pull/1/head
Alex Beregszaszi 8 years ago
parent 8b7970f429
commit b414777899
  1. 2
      src/app.js
  2. 6
      src/app/editor.js

@ -157,7 +157,7 @@ var run = function () {
// ----------------- editor ---------------------- // ----------------- editor ----------------------
var editor = new Editor() var editor = new Editor('input')
// ----------------- tabbed menu ------------------- // ----------------- tabbed menu -------------------
$('#options li').click(function (ev) { $('#options li').click(function (ev) {

@ -6,9 +6,9 @@ var ace = require('brace')
var Range = ace.acequire('ace/range').Range var Range = ace.acequire('ace/range').Range
require('../mode-solidity.js') require('../mode-solidity.js')
function Editor () { function Editor (editorElement) {
var editor = ace.edit('input') var editor = ace.edit(editorElement)
document.getElementById('input').editor = editor // required to access the editor during tests document.getElementById(editorElement).editor = editor // required to access the editor during tests
var event = new EventManager() var event = new EventManager()
this.event = event this.event = event
var sessions = {} var sessions = {}

Loading…
Cancel
Save