fix font type tooltip

This commit is contained in:
Ezequiel Bergamaschi 2014-05-02 01:15:12 -03:00
parent f8fee50076
commit 382af76753
2 changed files with 10 additions and 9 deletions

View File

@ -25,12 +25,12 @@ mindplot.widget.FontFamilyPanel = new Class({
buildPanel: function() { buildPanel: function() {
var content = $("<div class='toolbarPanel' id='fontFamilyPanel'></div>"); var content = $("<div class='toolbarPanel' id='fontFamilyPanel'></div>");
content.innerHTML = '' + content.html(
'<div id="times" model="Times" class="toolbarPanelLink" style="font-family:times;">Times</div>' + '<div id="times" model="Times" class="toolbarPanelLink" style="font-family:times;">Times</div>' +
'<div id="arial" model="Arial" style="font-family:arial;">Arial</div>' + '<div id="arial" model="Arial" style="font-family:arial;">Arial</div>' +
'<div id="tahoma" model="Tahoma" style="font-family:tahoma;">Tahoma</div>' + '<div id="tahoma" model="Tahoma" style="font-family:tahoma;">Tahoma</div>' +
'<div id="verdana" model="Verdana" style="font-family:verdana;">Verdana</div>'; '<div id="verdana" model="Verdana" style="font-family:verdana;">Verdana</div>'
);
return content; return content;
} }

View File

@ -25,11 +25,12 @@ mindplot.widget.ListToolbarPanel = new Class({
_initPanel: function () { _initPanel: function () {
// Register on toolbar elements ... // Register on toolbar elements ...
var me = this;
this.getPanelElem().children('div').bind('click', function (event) { this.getPanelElem().children('div').bind('click', function (event) {
event.stopPropagation(); event.stopPropagation();
this.hide(); me.hide();
var value = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id; var value = $defined($(this).attr('model')) ? $(this).attr('model') : $(this).attr('id');
this.getModel().setValue(value); me.getModel().setValue(value);
}); });
}, },
@ -38,12 +39,12 @@ mindplot.widget.ListToolbarPanel = new Class({
var menuElems = panelElem.find('div'); var menuElems = panelElem.find('div');
var value = this.getModel().getValue(); var value = this.getModel().getValue();
_.each(menuElems, function (elem) { _.each(menuElems, function (elem) {
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id; var elemValue = $defined($(elem).attr('model')) ? $(elem).attr('model') : $(elem).attr('id');
$assert(elemValue, "elemValue can not be null"); $assert(elemValue, "elemValue can not be null");
if (elemValue == value) if (elemValue == value)
elem.className = "toolbarPanelLinkSelectedLink"; $(elem).attr('class', "toolbarPanelLinkSelectedLink");
else else
elem.className = "toolbarPanelLink"; $(elem).attr('class', "toolbarPanelLink");
}); });
return panelElem; return panelElem;
} }