/** * Editable jQuery UI Tooltip * --------------------- * requires jquery ui 1.9.x */ (function ($) { //extend methods $.extend($.fn.editableContainer.Constructor.prototype, { containerName: 'tooltip', innerCss: '.ui-tooltip-content', //split options on containerOptions and formOptions splitOptions: function() { this.containerOptions = {}; this.formOptions = {}; //defaults for tooltip var cDef = $.ui[this.containerName].prototype.options; for(var k in this.options) { if(k in cDef) { this.containerOptions[k] = this.options[k]; } else { this.formOptions[k] = this.options[k]; } } }, initContainer: function(){ this.handlePlacement(); $.extend(this.containerOptions, { items: '*', content: ' ', track: false, open: $.proxy(function() { //disable events hiding tooltip by default this.container()._on(this.container().element, { mouseleave: function(e){ e.stopImmediatePropagation(); }, focusout: function(e){ e.stopImmediatePropagation(); } }); }, this) }); this.call(this.containerOptions); //disable standart triggering tooltip event this.container()._off(this.container().element, 'mouseover focusin'); }, tip: function() { return this.container()._find(this.container().element); }, innerShow: function() { this.call('open'); this.tip().addClass('editable-container'); this.initForm(); this.tip().find(this.innerCss) .empty() .append($('