1
У меня встроенный виджет ace на моей странице. Я добавил кнопку, которая считывает значение сеанса редактора, используя метод getvalue(). Редактор исчезает после нажатия кнопки. Что может быть причиной ошибки? Смотрите скриншот в приведенной ниже ссылке.Редактор Ace Code исчезает onclick
<ace-widget id="editor1" initial-focus theme="ace/theme/monokai" mode="ace/mode/json" softtabs="true" wrap="true">
This is a nice widget... and we are writing a long text here to show the effects of the `wrap` attribute.
</ace-widget>
<paper-button raised class="custom indigo" onclick="myrun()">Run</paper-button>
<paper-textarea label="autoresizing textarea input"></paper-textarea>
<script type="text/javascript">
function myrun(){
var editor = ace.edit("editor1");
var myVar = editor.getSession().getValue();
myVar= myVar.replace(/\d+/, '');
myVar = myVar.substring(0,myVar.indexOf('XXXXXXX'));
alert(myVar);
}
</script>