Finally viewmode.html render.

This commit is contained in:
Paulo Gustavo Veiga
2014-03-05 00:14:28 -03:00
parent 255f50eda8
commit e5186688ab
33 changed files with 158 additions and 159 deletions

View File

@@ -18,32 +18,28 @@
mindplot.widget.ListToolbarPanel = new Class({
Extends: mindplot.widget.ToolbarPaneItem,
initialize : function(buttonId, model) {
initialize: function (buttonId, model) {
this.parent(buttonId, model);
this._initPanel();
},
_initPanel: function () {
// Register on toolbar elements ...
var menuElems = this.getPanelElem().getElements('div');
menuElems.each(function(elem) {
elem.addEvent('click', function(event) {
event.stopPropagation();
this.hide();
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
this.getModel().setValue(value);
}.bind(this));
}.bind(this));
this.getPanelElem().children('div').bind('click', function (event) {
event.stopPropagation();
this.hide();
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
this.getModel().setValue(value);
});
},
_updateSelectedItem : function() {
_updateSelectedItem: function () {
var panelElem = this.getPanelElem();
var menuElems = panelElem.getElements('div');
var value = this.getModel().getValue();
menuElems.each(function(elem) {
menuElems.each(function (elem) {
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
$assert(elemValue,"elemValue can not be null");
$assert(elemValue, "elemValue can not be null");
if (elemValue == value)
elem.className = "toolbarPanelLinkSelectedLink";
else