mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
toggle
This commit is contained in:
parent
3a21998294
commit
baa4ceabba
@ -6,21 +6,14 @@ CM.init = function() {
|
||||
CM.modes = $.parseJSON($('#codemirror_modes').text());
|
||||
$enable_codemirror = $('#enable_codemirror');
|
||||
|
||||
if (typeof CM.editor == 'undefined') {
|
||||
CM.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
});
|
||||
}
|
||||
|
||||
$enable_codemirror.click(function() {
|
||||
|
||||
//todo: no rebind
|
||||
$('#lang').change(function() {
|
||||
CM.set_language();
|
||||
});
|
||||
|
||||
CM.toggle();
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
@ -30,10 +23,14 @@ CM.toggle = function() {
|
||||
CM.editor = undefined;
|
||||
CM.enabled = false;
|
||||
} else {
|
||||
CM.init();
|
||||
if (typeof CM.editor == 'undefined') {
|
||||
CM.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
});
|
||||
}
|
||||
CM.enabled = true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
CM.set_language = function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user