Merge fx-team to m-c

This commit is contained in:
Wes Kocher 2014-01-07 18:16:39 -08:00
commit 8100da35c9
3 changed files with 11 additions and 7 deletions

View File

@ -77,7 +77,9 @@ const CM_MAPPING = [
"redo",
"clearHistory",
"openDialog",
"refresh"
"refresh",
"getOption",
"setOption"
];
const { cssProperties, cssValues, cssColors } = getCSSKeywords();
@ -288,8 +290,7 @@ Editor.prototype = {
* See Editor.modes for the list of all suppoert modes.
*/
getMode: function () {
let cm = editors.get(this);
return cm.getOption("mode");
return this.getOption("mode");
},
/**
@ -297,8 +298,7 @@ Editor.prototype = {
* See Editor.modes for the list of all suppoert modes.
*/
setMode: function (value) {
let cm = editors.get(this);
cm.setOption("mode", value);
this.setOption("mode", value);
},
/**
@ -649,8 +649,7 @@ Editor.prototype = {
* True if the editor is in the read-only mode, false otherwise.
*/
isReadOnly: function () {
let cm = editors.get(this);
return cm.getOption("readOnly");
return this.getOption("readOnly");
},
/**

View File

@ -11,6 +11,11 @@ function test() {
let src = win.document.querySelector("iframe").getAttribute("src");
ok(~src.indexOf(".CodeMirror"), "correct iframe is there");
// getOption/setOption
ok(ed.getOption("styleActiveLine"), "getOption works");
ed.setOption("styleActiveLine", false);
ok(!ed.getOption("styleActiveLine"), "setOption works");
// Language modes
is(ed.getMode(), Editor.modes.text, "getMode");
ed.setMode(Editor.modes.js);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB