我正在尝试为 GoldenLayout 中的控件图标添加自定义工具提示。
到目前为止,我所做的是,我正在找到每个控制器图标的类并添加一个名为tooltip
并删除该属性的新title
属性。
这适用于close
& open in new window
,但对于minimise
andmaximise
我需要tooltip
动态设置值并且还需要删除title
属性
我无法实现该功能。请帮忙
完整代码https://jsfiddle.net/sutgfg1y/
myLayout.on('stackCreated', function(stack) {
stack
.header
.controlsContainer
.find('.lm_close') //get the close icon
.attr('tooltip', 'Close')
.removeAttr('title')
stack
.header
.controlsContainer
.find('.lm_popout') //get the close icon
.attr('tooltip', 'Open in new window')
.removeAttr('title')
stack
.header
.controlsContainer
.find('.lm_maximise')
.attr('tooltip', 'maxi')
.removeAttr('title')
.click(function() {
var maxi = stack
.header
.controlsContainer
.find('.lm_maximise')
.attr('tooltip')
alert(maxi)
})
});