Finally viewmode.html render.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user