Permalink
Browse files

another fix for texteditor

  • Loading branch information...
1 parent 3336b8f commit a3ab1ecb27aade851b36ce8b9169d206b4c360e4 @hofmeister committed Feb 21, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 js/lib/form.js
View
@@ -1116,8 +1116,10 @@ $wb.ui.form.TextEditor = $wb.Class('TextEditor',{
},
_loadMode:function() {
- if (typeof CodeMirror.modes[this.opts.mode] == 'undefined') {
- throw 'Invalid code mirror mode: ' + this.opts.mode + '. Remember to include all needed files before invoking TextEditor.';
+ var modeName = $.type(this.opts.mode) == 'string' ? this.opts.mode : this.opts.mode.name;
+
+ if (typeof CodeMirror.modes[modeName] == 'undefined') {
+ throw 'Invalid code mirror mode: ' + modeName + '. Remember to include all needed files before invoking TextEditor.';
}
this._init();
},

0 comments on commit a3ab1ec

Please sign in to comment.