From c53f1f96c86eb089dfa11749f6989516c9efbc2b Mon Sep 17 00:00:00 2001 From: vitalets <noginsk@rambler.ru> Date: Tue, 6 Aug 2013 10:27:43 +0400 Subject: [PATCH] more verbose error for container._off() --- src/containers/editable-tooltip.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/containers/editable-tooltip.js b/src/containers/editable-tooltip.js index 0c9a51f..ddfbf6f 100644 --- a/src/containers/editable-tooltip.js +++ b/src/containers/editable-tooltip.js @@ -44,8 +44,15 @@ this.call(this.containerOptions); - //disable standart triggering tooltip event - this.container()._off(this.container().element, 'mouseover focusin'); + //disable standart triggering tooltip event + //for some versions of jQueryUI it gives error: + //TypeError: this.container(...)._off is not a function + //see: https://github.com/vitalets/x-editable/issues/32 + if(this.container()._off) { + this.container()._off(this.container().element, 'mouseover focusin'); + } else { + $.error('this.container()._off is not a function. jQuery UI: ' + $.ui.version); + } }, tip: function() {