mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-03-10 23:46:35 +00:00
Tooltips should now be attached to a container close to the target element while avoiding button/input groups.
This commit is contained in:
@@ -19,7 +19,6 @@ module.exports = Marionette.ItemView.extend({
|
||||
}
|
||||
if(this.model.get('tooltip')) {
|
||||
this.$el.attr('title', this.model.get('tooltip'));
|
||||
this.$el.attr('data-container', 'body');
|
||||
}
|
||||
},
|
||||
onClick : function(){
|
||||
|
||||
@@ -1,8 +1,29 @@
|
||||
var $ = require('jquery');
|
||||
require('bootstrap');
|
||||
|
||||
var Tooltip = $.fn.tooltip.Constructor;
|
||||
|
||||
var origGetOptions = Tooltip.prototype.getOptions;
|
||||
Tooltip.prototype.getOptions = function(options) {
|
||||
var result = origGetOptions.call(this, options);
|
||||
|
||||
if (result.container === false) {
|
||||
|
||||
var container = this.$element.closest('.btn-group,.input-group').parent();
|
||||
|
||||
if (container.length) {
|
||||
result.container = container;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
appInitializer : function(){
|
||||
appInitializer : function() {
|
||||
|
||||
$('body').tooltip({selector : '[title]'});
|
||||
|
||||
return this;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user