Skip to content

Commit 675e20e

Browse files
committed
bah
1 parent fb2b84c commit 675e20e

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

v3/js/opt-office-mix.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ function officeMixEnterEditMode(firstTime) {
175175

176176
// set configuration on every code edit and option toggle, to
177177
// set the 'dirty bit' on the enclosing PPT file
178-
pyInputCodeMirror.on("change", saveCurrentConfiguration);
178+
if (useCodeMirror) {
179+
pyInputCodeMirror.on("change", saveCurrentConfiguration);
180+
}
181+
else {
182+
pyInputAceEditor.getSession().on("change", saveCurrentConfiguration);
183+
}
179184
$('select').change(saveCurrentConfiguration);
180185
}
181186
}
@@ -234,16 +239,21 @@ $(document).ready(function() {
234239
});
235240

236241

237-
pyInputCodeMirror = CodeMirror(document.getElementById('codeInputPane'), {
238-
mode: 'python',
239-
lineNumbers: true,
240-
tabSize: 4,
241-
indentUnit: 4,
242-
// convert tab into four spaces:
243-
extraKeys: {Tab: function(cm) {cm.replaceSelection(" ", "end");}}
244-
});
242+
if (useCodeMirror) {
243+
pyInputCodeMirror = CodeMirror(document.getElementById('codeInputPane'), {
244+
mode: 'python',
245+
lineNumbers: true,
246+
tabSize: 4,
247+
indentUnit: 4,
248+
// convert tab into four spaces:
249+
extraKeys: {Tab: function(cm) {cm.replaceSelection(" ", "end");}}
250+
});
245251

246-
pyInputCodeMirror.setSize(null, '350px');
252+
pyInputCodeMirror.setSize(null, '350px');
253+
}
254+
else {
255+
initAceEditor(350);
256+
}
247257

248258
$(window).resize(redrawConnectors);
249259

0 commit comments

Comments
 (0)