我正在尝试为 GoldenLayout 中的控件图标添加自定义工具提示。
到目前为止,我所做的是,我正在找到每个控制器图标的类并添加一个名为tooltip并删除该属性的新title属性。
这适用于close& open in new window,但对于minimiseandmaximise我需要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)
})
});