Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero committed Nov 5, 2018
1 parent 5011ab2 commit 4e2b02d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "juicy-ace-editor",
"version": "2.1.0",
"version": "2.2.0",
"description": "Custom Element with Ace(http://ace.c9.io/) code editor",
"license": "MIT",
"main": "juicy-ace-editor.html",
Expand Down
10 changes: 9 additions & 1 deletion juicy-ace-editor.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<!--
Custom Element with Ace code editor
http://juicy.github.io/juicy-ace-editor/
version: 2.1.0
version: 2.2.0
@demo index.html
@license MIT
@author
-->
<script src="../ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="../ace-builds/src-noconflict/ext-searchbox.js" type="text/javascript" charset="utf-8"></script>
<script src="../ace-builds/src-noconflict/ext-beautify.js" type="text/javascript" charset="utf-8"></script>


<template id="juicy-ace-editor">
<style>
Expand Down Expand Up @@ -74,6 +76,7 @@
// getElementById may not be polyfilled yet
self.container = clone.querySelector('#juicy-ace-editor-container');
shadowRoot.appendChild(clone);

return self;
}
connectedCallback() {
Expand Down Expand Up @@ -104,6 +107,8 @@
editor.getSession().on('change', function(event){
element.dispatchEvent(new CustomEvent("change", {bubbles: true, composed: true, detail: event}));
});

this._beautify = ace.require("ace/ext/beautify");
}

// handle theme changes
Expand Down Expand Up @@ -136,6 +141,9 @@
// container.appendChild(text);
this._attached = true;
}
beautify() {
this._beautify.beautify(this.editor.session);
}
disconnectedCallback() {
this._attached = false;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "juicy-ace-editor",
"description": "Custom Element wrapper for Ace code editor",
"version": "2.1.0",
"version": "2.2.0",
"author": "Juicy",
"license": "MIT",
"bugs": {
Expand Down

0 comments on commit 4e2b02d

Please sign in to comment.