Minor fixes.
This commit is contained in:
@@ -69,6 +69,8 @@ mindplot.widget.IconPanel = new Class({
|
||||
|
||||
show:function() {
|
||||
this.fireEvent("show");
|
||||
$(this._buttonId).className = 'buttonActive';
|
||||
|
||||
if (this.options.state == 'close') {
|
||||
if (!$defined(this.options.panel)) {
|
||||
this.init();
|
||||
@@ -84,7 +86,6 @@ mindplot.widget.IconPanel = new Class({
|
||||
this.fireEvent('onStart');
|
||||
this.registerClosePanel();
|
||||
this.options.state = 'open';
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -94,6 +95,7 @@ mindplot.widget.IconPanel = new Class({
|
||||
this.options.panel.setStyles({border: '1px solid transparent', opacity:0});
|
||||
this.registerOpenPanel();
|
||||
this.options.state = 'close';
|
||||
$(this._buttonId).className = 'button';
|
||||
}
|
||||
},
|
||||
|
||||
|
@@ -37,7 +37,9 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
};
|
||||
var fontFamilyPanel = new mindplot.widget.FontFamilyPanel("fontFamily", fontFamilyModel);
|
||||
fontFamilyPanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
fontFamilyPanel.addEvent('show', function() {
|
||||
this.clear()
|
||||
}.bind(this));
|
||||
this._toolbarElems.push(fontFamilyPanel);
|
||||
|
||||
var fontSizeModel = {
|
||||
@@ -53,7 +55,9 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
};
|
||||
var fontSizePanel = new mindplot.widget.FontSizePanel("fontSize", fontSizeModel);
|
||||
fontSizePanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
fontSizePanel.addEvent('show', function() {
|
||||
this.clear()
|
||||
}.bind(this));
|
||||
this._toolbarElems.push(fontSizePanel);
|
||||
|
||||
var topicShapeModel = {
|
||||
@@ -69,7 +73,9 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
};
|
||||
var topicShapePanel = new mindplot.widget.TopicShapePanel("topicShape", topicShapeModel);
|
||||
topicShapePanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
topicShapePanel.addEvent('show', function() {
|
||||
this.clear()
|
||||
}.bind(this));
|
||||
this._toolbarElems.push(topicShapePanel);
|
||||
|
||||
// Create icon panel dialog ...
|
||||
@@ -82,11 +88,13 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
};
|
||||
var iconPanel = new mindplot.widget.IconPanel('topicIcon', topicIconModel);
|
||||
iconPanel.addEvent('show',function(){this.clear()}.bind(this));
|
||||
iconPanel.addEvent('show', function() {
|
||||
this.clear()
|
||||
}.bind(this));
|
||||
this._toolbarElems.push(iconPanel);
|
||||
|
||||
|
||||
var topicColorPicker = new MooRainbow('topicColor', {
|
||||
var colorPickerOptions = {
|
||||
id: 'topicColor',
|
||||
imgPath: '../images/',
|
||||
startColor: [255, 255, 255],
|
||||
@@ -100,7 +108,8 @@ mindplot.widget.Menu = new Class({
|
||||
onComplete: function() {
|
||||
this.clear();
|
||||
}.bind(this)
|
||||
});
|
||||
};
|
||||
var topicColorPicker = new MooRainbow('topicColor', colorPickerOptions);
|
||||
this._colorPickers.push(topicColorPicker);
|
||||
|
||||
var borderColorPicker = new MooRainbow('topicBorder', {
|
||||
@@ -135,6 +144,72 @@ mindplot.widget.Menu = new Class({
|
||||
}.bind(this)
|
||||
});
|
||||
this._colorPickers.push(fontColorPicker);
|
||||
|
||||
|
||||
// Register Events ...
|
||||
$('zoomIn').addEvent('click', function(event) {
|
||||
designer.zoomIn();
|
||||
});
|
||||
|
||||
$('zoomOut').addEvent('click', function(event) {
|
||||
designer.zoomOut();
|
||||
});
|
||||
|
||||
$('undoEdition').addEvent('click', function(event) {
|
||||
designer.undo();
|
||||
});
|
||||
|
||||
$('redoEdition').addEvent('click', function(event) {
|
||||
designer.redo();
|
||||
});
|
||||
|
||||
designer.addEventListener("modelUpdate", function(event) {
|
||||
if (event.undoSteps > 0) {
|
||||
$("undoEdition").setStyle("background-image", "url(../images/file_undo.png)");
|
||||
} else {
|
||||
$("undoEdition").setStyle("background-image", "url(../images/file_undo_dis.png)");
|
||||
}
|
||||
|
||||
if (event.redoSteps > 0) {
|
||||
$("redoEdition").setStyle("background-image", "url(../images/file_redo.png)");
|
||||
} else {
|
||||
$("redoEdition").setStyle("background-image", "url(../images/file_redo_dis.png)");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('addTopic').addEvent('click', function(event) {
|
||||
designer.createSiblingForSelectedNode();
|
||||
});
|
||||
|
||||
$('deleteTopic').addEvent('click', function(event) {
|
||||
designer.deleteCurrentNode();
|
||||
});
|
||||
|
||||
|
||||
$('topicLink').addEvent('click', function(event) {
|
||||
designer.addLink2SelectedNode();
|
||||
|
||||
});
|
||||
|
||||
$('topicRelation').addEvent('click', function(event) {
|
||||
designer.addRelationShip2SelectedNode(event);
|
||||
});
|
||||
|
||||
$('topicNote').addEvent('click', function(event) {
|
||||
designer.addNote2SelectedNode();
|
||||
|
||||
});
|
||||
|
||||
$('fontBold').addEvent('click', function(event) {
|
||||
designer.setWeight2SelectedNode();
|
||||
});
|
||||
|
||||
$('fontItalic').addEvent('click', function(event) {
|
||||
designer.setStyle2SelectedNode();
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
clear : function() {
|
||||
|
@@ -22,6 +22,7 @@ mindplot.widget.ToolbarPanel = new Class({
|
||||
$assert(buttonId, "buttonId can not be null");
|
||||
$assert(model, "model can not be null");
|
||||
this._model = model;
|
||||
this._buttonId = buttonId;
|
||||
this._panelId = this.initPanel(buttonId);
|
||||
},
|
||||
|
||||
@@ -42,10 +43,11 @@ mindplot.widget.ToolbarPanel = new Class({
|
||||
// Register on toolbar elements ...
|
||||
var menuElems = panelElem.getElements('div');
|
||||
menuElems.forEach(function(elem) {
|
||||
elem.addEvent('click', function() {
|
||||
elem.addEvent('click', function(event) {
|
||||
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
|
||||
this._model.setValue(value);
|
||||
this.hide();
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
@@ -77,10 +79,14 @@ mindplot.widget.ToolbarPanel = new Class({
|
||||
});
|
||||
$(this._panelId).setStyle('display', 'block');
|
||||
|
||||
// Mark the button as active...
|
||||
$(this._buttonId).className = 'buttonActive';
|
||||
},
|
||||
|
||||
hide : function() {
|
||||
$(this._panelId).setStyle('display', 'none');
|
||||
$(this._buttonId).className = 'button';
|
||||
|
||||
},
|
||||
|
||||
isVisible : function() {
|
||||
|
Reference in New Issue
Block a user