aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorHendrik Leppelsack <hendrik@leppelsack.de>2015-06-22 12:48:04 +0200
committerHendrik Leppelsack <hendrik@leppelsack.de>2015-06-22 13:32:06 +0200
commitf66e9af9a0589023bb171240fd5c9db8385efebf (patch)
tree84f1888fa7f9fbad1a5db318e319fd65d93f524c /core/js/js.js
parent9e48f7f3ba85d1ad57ee4ab4946af51338f004f8 (diff)
downloadnextcloud-server-f66e9af9a0589023bb171240fd5c9db8385efebf.tar.gz
nextcloud-server-f66e9af9a0589023bb171240fd5c9db8385efebf.zip
replaced 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 7604dc2a5b7..92e534f55fe 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1742,3 +1742,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
+ };
+ console.log(argument);
+ // tooltip direction
+ if(argument.gravity) {
+ switch(argument.gravity) {
+ case 'n':
+ case 'nw':
+ case 'ne':
+ console.log('bottom');
+ options.placement='bottom';
+ break;
+ case 's':
+ case 'sw':
+ case 'se':
+ options.placement='top';
+ break;
+ case 'w':
+ console.log('right');
+ 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;
+ }
+ jQuery.fn.tooltip.call(this, options);
+ }
+ jQuery.fn.tooltip.call(this, argument);
+}