From 252a34dc08190764acda9e7ab1432fad93565127 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 30 Jul 2015 19:45:54 +1000 Subject: [PATCH] Adds alt syntax for tooltip data-toggle will conflict with dropdown, eg: data-toggle="dropdown" data-control="tooltip" --- modules/system/assets/ui/js/tooltip.js | 2 +- modules/system/assets/ui/storm-min.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/assets/ui/js/tooltip.js b/modules/system/assets/ui/js/tooltip.js index d31c2cbbf..903110b25 100644 --- a/modules/system/assets/ui/js/tooltip.js +++ b/modules/system/assets/ui/js/tooltip.js @@ -20,7 +20,7 @@ (function($){ $(document).render(function(){ - $('[data-toggle="tooltip"]').tooltip() + $('[data-control="tooltip"], [data-toggle="tooltip"]').tooltip() }) })(jQuery); \ No newline at end of file diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index bae95a45c..2a347942d 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -464,7 +464,7 @@ if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options))) if(typeof option=='string')data[option]()})} $.fn.tooltip.Constructor=Tooltip $.fn.tooltip.noConflict=function(){$.fn.tooltip=old -return this}}(jQuery);(function($){$(document).render(function(){$('[data-toggle="tooltip"]').tooltip()})})(jQuery);+function($){"use strict";var BalloonSelector=function(element,options){this.$el=$(element) +return this}}(jQuery);(function($){$(document).render(function(){$('[data-control="tooltip"], [data-toggle="tooltip"]').tooltip()})})(jQuery);+function($){"use strict";var BalloonSelector=function(element,options){this.$el=$(element) this.$field=$('input',this.$el) this.options=options||{};var self=this;$('li',this.$el).click(function(){if(self.$el.hasClass('control-disabled')) return @@ -1400,7 +1400,7 @@ $(this).append(dropdown)} $(document.body).removeClass('dropdown-open');}) var $dropdown,$container,$target function fixDropdownPosition(){var position=$container.offset() -$dropdown.css({position:'fixed',top:position.top-$(window).scrollTop()+$target.outerHeight(),left:position.left})} +$dropdown.css({position:'fixed',top:position.top-1-$(window).scrollTop()+$target.outerHeight(),left:position.left})} $(document).on('shown.bs.dropdown','.dropdown.dropdown-fixed',function(event,eventData){$container=$(this) $dropdown=$('.dropdown-menu',$container) $target=$(eventData.relatedTarget) @@ -1428,7 +1428,7 @@ if(typeof option=='string')data[option].call($this)})} $.fn.callout.Constructor=Callout $.fn.callout.noConflict=function(){$.fn.callout=old return this} -$(document).on('click.oc.callout.data-api',dismiss,Callout.prototype.close)}(jQuery);(function($){$(document).render(function(){$('[data-toggle="tooltip"]').tooltip()})})(jQuery);(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory;}else{factory(jQuery);}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel'in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;}} +$(document).on('click.oc.callout.data-api',dismiss,Callout.prototype.close)}(jQuery);(function($){$(document).render(function(){$('[data-control="tooltip"], [data-toggle="tooltip"]').tooltip()})})(jQuery);(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory;}else{factory(jQuery);}}(function($){var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'],toBind=('onwheel'in document||document.documentMode>=9)?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;}} var special=$.event.special.mousewheel={version:'3.1.9',setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,false);}}else{this.onmousewheel=handler;} $.data(this,'mousewheel-line-height',special.getLineHeight(this));$.data(this,'mousewheel-page-height',special.getPageHeight(this));},teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,false);}}else{this.onmousewheel=null;}},getLineHeight:function(elem){return parseInt($(elem)['offsetParent'in $.fn?'offsetParent':'parent']().css('fontSize'),10);},getPageHeight:function(elem){return $(elem).height();},settings:{adjustOldDeltas:true}};$.fn.extend({mousewheel:function(fn){return fn?this.bind('mousewheel',fn):this.trigger('mousewheel');},unmousewheel:function(fn){return this.unbind('mousewheel',fn);}});function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0;event=$.event.fix(orgEvent);event.type='mousewheel';if('detail'in orgEvent){deltaY=orgEvent.detail*-1;} if('wheelDelta'in orgEvent){deltaY=orgEvent.wheelDelta;}