Browse Source

Issue with ToDo WYSIWG area (#3374) (fixes frappe/erpnext#7773)

* fixes #7773: Issue with ToDo WYSIWG area
version-14
tundebabzy 8 years ago
committed by Faris Ansari
parent
commit
b1936b8fc7
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      frappe/public/js/frappe/form/control.js

+ 9
- 0
frappe/public/js/frappe/form/control.js View File

@@ -1647,6 +1647,15 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
prettifyHtml: true, prettifyHtml: true,
dialogsInBody: true, dialogsInBody: true,
callbacks: { callbacks: {
onInit: function() {
// firefox hack that puts the caret in the wrong position
// when div is empty. To fix, seed with a <br>.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=550434
$(".note-editable[contenteditable='true']").on('focus', function(){
var $this = $(this);
$this.html( $this.html() + '<br>' );
});
},
onChange: function(value) { onChange: function(value) {
me.parse_validate_and_set_in_model(value); me.parse_validate_and_set_in_model(value);
}, },


Loading…
Cancel
Save