Skip to content

Commit 8692227

Browse files
committed
Deploying to gh-pages from @ 487207e 🚀
1 parent c7032a5 commit 8692227

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

samples/toolbar/sample.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
var buildDom = require("ace/lib/dom").buildDom;
1+
var buildDom = ace.require("ace/lib/dom").buildDom;
2+
var snippetManager = ace.require("ace/snippets").snippetManager;
23
var editor = ace.edit();
34
editor.setOptions({
45
theme: "ace/theme/tomorrow_night_eighties",
@@ -57,20 +58,18 @@ buildDom([
5758
"button", {
5859
style: "font-weight: bold",
5960
onclick: function () {
60-
editor.insertSnippet("**${1:$SELECTION}**");
61+
snippetManager.insertSnippet(editor, "**${1:$SELECTION}**");
6162
editor.renderer.scrollCursorIntoView();
6263
}
6364
}, "bold"
6465
], [
6566
"button", {
6667
style: "font-style: italic",
6768
onclick: function () {
68-
editor.insertSnippet("*${1:$SELECTION}*");
69+
snippetManager.insertSnippet(editor, "*${1:$SELECTION}*");
6970
editor.renderer.scrollCursorIntoView();
7071
}
7172
}, "Italic"
7273
]
7374
], document.body, refs);
7475
document.body.appendChild(editor.container);
75-
76-
window.editor = editor;

0 commit comments

Comments
 (0)