dist/input-ace.js in chr-0.2.8 vs dist/input-ace.js in chr-0.3.5
- old
+ new
@@ -24826,21 +24826,25 @@
return this.$el.append(this.$editor);
};
InputHtml.prototype._update_inputs = function() {
this.value = this.editor.getSession().getValue();
- return this.$input.val(this.value);
+ this.$input.val(this.value);
+ return this.$input.trigger('change');
};
InputHtml.prototype.initialize = function() {
- var base;
+ var base, base1;
+ if (typeof (base = this.config).beforeInitialize === "function") {
+ base.beforeInitialize(this);
+ }
this.editor = ace.edit(this.$editor.get(0));
+ this.editor.$blockScrolling = Infinity;
this.session = this.editor.getSession();
this.session.setValue(this.$input.val());
this.session.setUseWrapMode(true);
this.session.setMode("ace/mode/html");
- this.editor.$blockScrolling = Infinity;
this.editor.setOptions({
autoScrollEditorIntoView: true,
minLines: 5,
maxLines: Infinity,
showLineNumbers: false,
@@ -24851,11 +24855,11 @@
this.session.on('change', (function(_this) {
return function(e) {
return _this._update_inputs();
};
})(this));
- return typeof (base = this.config).onInitialize === "function" ? base.onInitialize(this) : void 0;
+ return typeof (base1 = this.config).onInitialize === "function" ? base1.onInitialize(this) : void 0;
};
InputHtml.prototype.updateValue = function(value) {
this.value = value;
this.editor.getSession().setValue(this.value);
@@ -24891,23 +24895,29 @@
InputMarkdown.prototype._update_inputs = function() {
var html, md_source;
md_source = this.session.getValue();
this.$input.val(md_source);
+ this.$input.trigger('change');
if (this.$inputHtml) {
html = marked(md_source);
- return this.$inputHtml.val(html);
+ this.$inputHtml.val(html);
+ return this.$inputHtml.trigger('change');
}
};
InputMarkdown.prototype.initialize = function() {
- var base;
+ var base, base1;
+ if (typeof (base = this.config).beforeInitialize === "function") {
+ base.beforeInitialize(this);
+ }
this.editor = ace.edit(this.$editor.get(0));
+ this.editor.$blockScrolling = Infinity;
this.session = this.editor.getSession();
this.session.setValue(this.$input.val());
+ this.session.setUseWrapMode(true);
this.session.setMode("ace/mode/markdown");
- this.editor.$blockScrolling = Infinity;
this.editor.setOptions({
autoScrollEditorIntoView: true,
minLines: 5,
maxLines: Infinity,
showLineNumbers: false,
@@ -24918,10 +24928,10 @@
this.session.on('change', (function(_this) {
return function(e) {
return _this._update_inputs();
};
})(this));
- return typeof (base = this.config).onInitialize === "function" ? base.onInitialize(this) : void 0;
+ return typeof (base1 = this.config).onInitialize === "function" ? base1.onInitialize(this) : void 0;
};
InputMarkdown.prototype.updateValue = function(value) {
this.value = value;
this.session.setValue(this.value);