Bug message: uncaught exception: text can not be null, line:0, : fixed.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-01 10:17:15 -03:00
parent 00829bfcc4
commit c4f4756e4a
3 changed files with 36 additions and 35 deletions

View File

@ -20,6 +20,7 @@ mindplot.model.NoteModel = new Class({
Extends:mindplot.model.FeatureModel,
initialize:function (attributes) {
this.parent(mindplot.model.NoteModel.FEATURE_TYPE);
if (attributes.text)
this.setText(attributes.text);
},

View File

@ -170,7 +170,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
},
_noteTextToXML:function (document, elem, text) {
if (text.indexOf('\n') == -1) {
if (text.indexOf('\n') == -1 && text.indexOf("&") == -1 && text.indexOf("<") == -1 && text.indexOf("\"") == -1) {
elem.setAttribute('text', text);
} else {
var textDom = document.createElement("text");
@ -256,7 +256,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
var topic = mindmap.createNode(type, id);
var text = domElem.getAttribute('text');
if ($defined(text)) {
if ($defined(text) && text) {
topic.setText(text);
}

View File

@ -77,8 +77,7 @@ mindplot.widget.NoteEditor = new Class({
textArea.setStyles({
'width':'100%',
'height':80
,resize: 'none'
'height':80, resize:'none'
});
textArea.inject(form);
@ -86,8 +85,9 @@ mindplot.widget.NoteEditor = new Class({
form.addEvent('submit', function (event) {
event.preventDefault();
event.stopPropagation();
if (textArea.value ) {
model.setValue(textArea.value);
}
this.close();
}.bind(this));