aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorBernhard Posselt <Raydiation@users.noreply.github.com>2015-07-23 19:25:09 +0200
committerBernhard Posselt <Raydiation@users.noreply.github.com>2015-07-23 19:25:09 +0200
commit582f07950f45d9e0bdfa8faaefa105cad5d39420 (patch)
tree83582e253b040995dfe8b337b137e49448087903 /core/js/js.js
parent01b7e306c427f00d1ce4570c3d1bc90f72e25644 (diff)
parent03a6e12bdb77242d38e08c9f3c78076e499bcaff (diff)
downloadnextcloud-server-582f07950f45d9e0bdfa8faaefa105cad5d39420.tar.gz
nextcloud-server-582f07950f45d9e0bdfa8faaefa105cad5d39420.zip
Merge pull request #17075 from owncloud/bootstrap-tooltip
Replace jQuery tipsy with bootstrap tooltip
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index ba456b54c6d..226fea3a3cb 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1839,3 +1839,61 @@ function getScrollBarWidth() {
return (w1 - w2);
}
+
+/**
+ * jQuery tipsy shim for the bootstrap tooltip
+ */
+jQuery.fn.tipsy = function(argument) {
+ console.warn('Deprecation warning: tipsy is deprecated. Use tooltip instead.');
+ if(typeof argument === 'object' && argument !== null) {
+
+ // tipsy defaults
+ var options = {
+ placement: 'bottom',
+ delay: { 'show': 0, 'hide': 0},
+ trigger: 'hover',
+ html: false
+ };
+ if(argument.gravity) {
+ switch(argument.gravity) {
+ case 'n':
+ case 'nw':
+ case 'ne':
+ options.placement='bottom';
+ break;
+ case 's':
+ case 'sw':
+ case 'se':
+ options.placement='top';
+ break;
+ case 'w':
+ options.placement='right';
+ break;
+ case 'e':
+ options.placement='left';
+ break;
+ }
+ }
+ if(argument.trigger) {
+ options.trigger = argument.trigger;
+ }
+ if(argument.delayIn) {
+ options.delay["show"] = argument.delayIn;
+ }
+ if(argument.delayOut) {
+ options.delay["hide"] = argument.delayOut;
+ }
+ if(argument.html) {
+ options.html = true;
+ }
+ if(argument.title) {
+ options.title = argument.title;
+ }
+ // destroy old tooltip in case the title has changed
+ jQuery.fn.tooltip.call(this, 'destroy');
+ jQuery.fn.tooltip.call(this, options);
+ } else {
+ this.tooltip(argument);
+ jQuery.fn.tooltip.call(this, argument);
+ }
+}