Skip to content

Commit

Permalink
fix br bug
Browse files Browse the repository at this point in the history
  • Loading branch information
steelydylan committed Feb 6, 2018
1 parent ef70f99 commit aaf3b84
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
9 changes: 6 additions & 3 deletions js/jquery-lite-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12910,7 +12910,7 @@ var LiteEditor = function (_aTemplate) {

if (selector.value) {
var value = selector.value;
if (_this.data.sourceFirst) {
if (!_this.data.sourceFirst) {
value = _this.makeEditableHtml(value);
}
if (_this.data.escapeNotRegisteredTags) {
Expand Down Expand Up @@ -13264,8 +13264,8 @@ var LiteEditor = function (_aTemplate) {
data.canRedo = this.canRedo();
if (data.firstValue) {
data.formatedValue = this.data.firstValue;
data.firstValue = '';
} else {
data.firstValue = null;
} else if (!data.showSource) {
data.formatedValue = this.format(data.value);
}
if (data.value) {
Expand Down Expand Up @@ -13551,6 +13551,9 @@ var LiteEditor = function (_aTemplate) {
value: function toggleSource() {
var source = this.data.showSource;
this.data.showSource = !source;
if (this.data.showSource) {
this.data.formatedValue = this.format(this.data.value);
}
this.update();
}
}, {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery-lite-editor.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions js/lite-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12885,7 +12885,7 @@ var LiteEditor = function (_aTemplate) {

if (selector.value) {
var value = selector.value;
if (_this.data.sourceFirst) {
if (!_this.data.sourceFirst) {
value = _this.makeEditableHtml(value);
}
if (_this.data.escapeNotRegisteredTags) {
Expand Down Expand Up @@ -13239,8 +13239,8 @@ var LiteEditor = function (_aTemplate) {
data.canRedo = this.canRedo();
if (data.firstValue) {
data.formatedValue = this.data.firstValue;
data.firstValue = '';
} else {
data.firstValue = null;
} else if (!data.showSource) {
data.formatedValue = this.format(data.value);
}
if (data.value) {
Expand Down Expand Up @@ -13526,6 +13526,9 @@ var LiteEditor = function (_aTemplate) {
value: function toggleSource() {
var source = this.data.showSource;
this.data.showSource = !source;
if (this.data.showSource) {
this.data.formatedValue = this.format(this.data.value);
}
this.update();
}
}, {
Expand Down
4 changes: 2 additions & 2 deletions js/lite-editor.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions lib/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ var LiteEditor = function (_aTemplate) {

if (selector.value) {
var value = selector.value;
if (_this.data.sourceFirst) {
if (!_this.data.sourceFirst) {
value = _this.makeEditableHtml(value);
}
if (_this.data.escapeNotRegisteredTags) {
Expand Down Expand Up @@ -528,8 +528,8 @@ var LiteEditor = function (_aTemplate) {
data.canRedo = this.canRedo();
if (data.firstValue) {
data.formatedValue = this.data.firstValue;
data.firstValue = '';
} else {
data.firstValue = null;
} else if (!data.showSource) {
data.formatedValue = this.format(data.value);
}
if (data.value) {
Expand Down Expand Up @@ -815,6 +815,9 @@ var LiteEditor = function (_aTemplate) {
value: function toggleSource() {
var source = this.data.showSource;
this.data.showSource = !source;
if (this.data.showSource) {
this.data.formatedValue = this.format(this.data.value);
}
this.update();
}
}, {
Expand Down
9 changes: 6 additions & 3 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class LiteEditor extends aTemplate {

if (selector.value) {
let value = selector.value;
if (this.data.sourceFirst) {
if (!this.data.sourceFirst) {
value = this.makeEditableHtml(value);
}
if (this.data.escapeNotRegisteredTags) {
Expand Down Expand Up @@ -484,8 +484,8 @@ export default class LiteEditor extends aTemplate {
data.canRedo = this.canRedo();
if (data.firstValue) {
data.formatedValue = this.data.firstValue;
data.firstValue = '';
} else {
data.firstValue = null;
} else if (!data.showSource) {
data.formatedValue = this.format(data.value);
}
if (data.value) {
Expand Down Expand Up @@ -747,6 +747,9 @@ export default class LiteEditor extends aTemplate {
toggleSource() {
const source = this.data.showSource;
this.data.showSource = !source;
if (this.data.showSource) {
this.data.formatedValue = this.format(this.data.value);
}
this.update();
}

Expand Down

0 comments on commit aaf3b84

Please # to comment.