Editor working .

This commit is contained in:
Paulo Veiga
2011-10-14 22:56:20 -03:00
parent 7b42b6c1cd
commit 2a37f2e422
94 changed files with 1350 additions and 678 deletions

View File

@@ -28,27 +28,27 @@ mindplot.widget.ListToolbarPanel = new Class({
var menuElems = this.getPanelElem().getElements('div');
menuElems.forEach(function(elem) {
elem.addEvent('click', function(event) {
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
this.getModel().setValue(value);
event.stopPropagation();
this.hide();
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
this.getModel().setValue(value);
}.bind(this));
}.bind(this));
},
show : function() {
if (!this.isVisible()) {
var menuElems = this.getPanelElem().getElements('div');
var value = this.getModel().getValue();
menuElems.forEach(function(elem) {
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
if (elemValue == value)
elem.className = "toolbarPanelLinkSelectedLink";
else
elem.className = "toolbarPanelLink";
});
this.parent();
}
_updateSelectedItem : function() {
var panelElem = this.getPanelElem();
var menuElems = panelElem.getElements('div');
var value = this.getModel().getValue();
menuElems.forEach(function(elem) {
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
$assert(elemValue,"elemValue can not be null");
if (elemValue == value)
elem.className = "toolbarPanelLinkSelectedLink";
else
elem.className = "toolbarPanelLink";
});
return panelElem;
}
});