UNPKG

slickgrid

Version:

A lightning fast JavaScript grid/spreadsheet

9 lines 1.11 kB
/** * SlickGrid v3.0.2 * (c) 2009-present Michael Leibman * homepage: http://github.com/mleibman/slickgrid * license: MIT * date: 2022-11-14 * file: ./plugins/slick.autotooltips.js */ !function(r){r.extend(!0,window,{Slick:{AutoTooltips:function(n){var l,t={enableForCells:!0,enableForHeaderCells:!1,maxToolTipLength:null,replaceExisting:!0};function o(e){var t,e=l.getCellFromEvent(e);!e||(e=r(l.getCellNode(e.row,e.cell))).attr("title")&&!n.replaceExisting||(e.innerWidth()<e[0].scrollWidth?(t=r.trim(e.text()),n.maxToolTipLength&&t.length>n.maxToolTipLength&&(t=t.substr(0,n.maxToolTipLength-3)+"...")):t="",e.attr("title",t))}function i(e,t){t=t.column,e=r(e.target).closest(".slick-header-column");t&&!t.toolTip&&e.attr("title",e.innerWidth()<e[0].scrollWidth?t.name:"")}r.extend(this,{init:function(e){n=r.extend(!0,{},t,n),l=e,n.enableForCells&&l.onMouseEnter.subscribe(o),n.enableForHeaderCells&&l.onHeaderMouseEnter.subscribe(i)},destroy:function(){n.enableForCells&&l.onMouseEnter.unsubscribe(o),n.enableForHeaderCells&&l.onHeaderMouseEnter.unsubscribe(i)},pluginName:"AutoTooltips"})}}})}(jQuery);