fix font type tooltip

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

View File

@ -25,12 +25,12 @@ mindplot.widget.FontFamilyPanel = new Class({
buildPanel: function() {
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="arial" model="Arial" style="font-family:arial;">Arial</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;
}

View File

@ -25,11 +25,12 @@ mindplot.widget.ListToolbarPanel = new Class({
_initPanel: function () {
// Register on toolbar elements ...
var me = 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);
me.hide();
var value = $defined($(this).attr('model')) ? $(this).attr('model') : $(this).attr('id');
me.getModel().setValue(value);
});
},
@ -38,12 +39,12 @@ mindplot.widget.ListToolbarPanel = new Class({
var menuElems = panelElem.find('div');
var value = this.getModel().getValue();
_.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");
if (elemValue == value)
elem.className = "toolbarPanelLinkSelectedLink";
$(elem).attr('class', "toolbarPanelLinkSelectedLink");
else
elem.className = "toolbarPanelLink";
$(elem).attr('class', "toolbarPanelLink");
});
return panelElem;
}