Skip to content

Commit

Permalink
vitmalina#1312 fixed tooltip in toolbar
Browse files Browse the repository at this point in the history
also fixed translation of menu item and tooltip in menu item
  • Loading branch information
bwl21 committed Aug 10, 2016
1 parent fddae14 commit eba7e12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/w2toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@
html += '<table cellpadding="0" cellspacing="0" '+
' class="w2ui-button '+ (item.checked ? 'checked' : '') +'" '+
' onclick = "var el=w2ui[\''+ this.name + '\']; if (el) el.click(\''+ item.id +'\', event);" '+
' ' + (item.tooltip ? 'title="'+ w2utils.lang(item.tooltip) +'"' : '') +
' onmouseover = "' + (!item.disabled ? "jQuery(this).addClass('over'); w2ui['"+ this.name +"'].tooltipShow('"+ item.id +"', event);" : "") + '"'+
' onmouseout = "' + (!item.disabled ? "jQuery(this).removeClass('over').removeClass('down'); w2ui['"+ this.name +"'].tooltipHide('"+ item.id +"', event);" : "") + '"'+
' onmousedown = "' + (!item.disabled ? "jQuery(this).addClass('down');" : "") + '"'+
Expand Down
4 changes: 2 additions & 2 deletions src/w2utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2708,15 +2708,15 @@ w2utils.event = {
if (mitem.count == null && mitem.hotkey == null) colspan++;
if (mitem.tooltip == null && mitem.hint != null) mitem.tooltip = mitem.hint; // for backward compatibility
menu_html +=
'<tr index="'+ f + '" style="'+ (mitem.style ? mitem.style : '') +'" '+ (mitem.tooltip ? 'title="'+ mitem.tooltip +'"' : '') +
'<tr index="'+ f + '" style="'+ (mitem.style ? mitem.style : '') +'" '+ (mitem.tooltip ? 'title="'+ w2utils.lang(mitem.tooltip) +'"' : '') +
' class="'+ bg +' '+ (options.index === f ? 'w2ui-selected' : '') + ' ' + (mitem.disabled === true ? 'w2ui-disabled' : '') +'"'+
' onmousedown="if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' jQuery.fn.w2menuDown(event, \''+ f +'\');"'+
' onclick="event.stopPropagation(); '+
' if ('+ (mitem.disabled === true ? 'true' : 'false') + ') return;'+
' jQuery.fn.w2menuClick(event, \''+ f +'\');">'+
imgd +
' <td class="menu-text" colspan="'+ colspan +'">'+ txt +'</td>'+
' <td class="menu-text" colspan="'+ colspan +'">'+ w2utils.lang(txt) +'</td>'+
' <td class="menu-count">'+
(mitem.count != null ? '<span>' + mitem.count + '</span>' : '') +
(mitem.hotkey != null ? '<span class="hotkey">' + mitem.hotkey + '</span>' : '') +
Expand Down

0 comments on commit eba7e12

Please sign in to comment.