fixing bugs
This commit is contained in:
@@ -28,7 +28,7 @@ mindplot.XMLMindmapSerializer_Beta.prototype.toXML = function(mindmap)
|
||||
// Store map attributes ...
|
||||
var mapElem = document.createElement("map");
|
||||
var name = mindmap.getId();
|
||||
if (name)
|
||||
if (core.Utils.isDefined(name))
|
||||
{
|
||||
mapElem.setAttribute('name', name);
|
||||
}
|
||||
@@ -69,12 +69,12 @@ mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, to
|
||||
}
|
||||
|
||||
var text = topic.getText();
|
||||
if (text) {
|
||||
if (core.Utils.isDefined(text)) {
|
||||
parentTopic.setAttribute('text', text);
|
||||
}
|
||||
|
||||
var shape = topic.getShapeType();
|
||||
if (shape) {
|
||||
if (core.Utils.isDefined(shape)) {
|
||||
parentTopic.setAttribute('shape', shape);
|
||||
}
|
||||
|
||||
@@ -101,18 +101,19 @@ mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, to
|
||||
var fontStyle = topic.getFontStyle();
|
||||
font += (fontStyle ? fontStyle : '') + ';';
|
||||
|
||||
if (fontFamily || fontSize || fontColor || fontWeight || fontStyle)
|
||||
if (core.Utils.isDefined(fontFamily) || core.Utils.isDefined(fontSize) || core.Utils.isDefined(fontColor)
|
||||
|| core.Utils.isDefined(fontWeight )|| core.Utils.isDefined(fontStyle))
|
||||
{
|
||||
parentTopic.setAttribute('fontStyle', font);
|
||||
}
|
||||
|
||||
var bgColor = topic.getBackgroundColor();
|
||||
if (bgColor) {
|
||||
if (core.Utils.isDefined(bgColor)) {
|
||||
parentTopic.setAttribute('bgColor', bgColor);
|
||||
}
|
||||
|
||||
var brColor = topic.getBorderColor();
|
||||
if (brColor) {
|
||||
if (core.Utils.isDefined(brColor)) {
|
||||
parentTopic.setAttribute('brColor', brColor);
|
||||
}
|
||||
|
||||
@@ -207,28 +208,28 @@ mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem
|
||||
|
||||
// Load attributes...
|
||||
var text = domElem.getAttribute('text');
|
||||
if (text) {
|
||||
if (core.Utils.isDefined(text)) {
|
||||
topic.setText(text);
|
||||
}
|
||||
|
||||
var order = domElem.getAttribute('order');
|
||||
if (order) {
|
||||
if (core.Utils.isDefined(order)) {
|
||||
topic.setOrder(order);
|
||||
}
|
||||
|
||||
var shape = domElem.getAttribute('shape');
|
||||
if (shape) {
|
||||
if (core.Utils.isDefined(shape)) {
|
||||
topic.setShapeType(shape);
|
||||
}
|
||||
|
||||
var isShrink = domElem.getAttribute('shrink');
|
||||
if(isShrink)
|
||||
if(core.Utils.isDefined(isShrink))
|
||||
{
|
||||
topic.setChildrenShrinked(isShrink);
|
||||
}
|
||||
|
||||
var fontStyle = domElem.getAttribute('fontStyle');
|
||||
if (fontStyle) {
|
||||
if (core.Utils.isDefined(fontStyle)) {
|
||||
var font = fontStyle.split(';');
|
||||
|
||||
if (font[0])
|
||||
@@ -258,17 +259,17 @@ mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem
|
||||
}
|
||||
|
||||
var bgColor = domElem.getAttribute('bgColor');
|
||||
if (bgColor) {
|
||||
if (core.Utils.isDefined(bgColor)) {
|
||||
topic.setBackgroundColor(bgColor);
|
||||
}
|
||||
|
||||
var borderColor = domElem.getAttribute('brColor');
|
||||
if (borderColor) {
|
||||
if (core.Utils.isDefined(borderColor)) {
|
||||
topic.setBorderColor(borderColor);
|
||||
}
|
||||
|
||||
var position = domElem.getAttribute('position');
|
||||
if (position) {
|
||||
if (core.Utils.isDefined(position)) {
|
||||
var pos = position.split(',');
|
||||
topic.setPosition(pos[0], pos[1]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user