fomantic-ui 2.9.3-beta.1 → 2.9.3-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.all-contributorsrc +9 -0
- package/CONTRIBUTORS.md +102 -99
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -5
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +14 -8
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +6 -6
- package/dist/components/calendar.js +1 -6
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -5
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -5
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +19 -2
- package/dist/components/dropdown.js +29 -14
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -6
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +40 -27
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +52 -5
- package/dist/components/form.js +32 -24
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +21 -2
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +9 -3
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +6 -3
- package/dist/components/modal.js +44 -32
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +16 -8
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +41 -40
- package/dist/components/popup.js +25 -17
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -6
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -5
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +3 -6
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +29 -6
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -5
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +15 -8
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +122 -31
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +23 -20
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +17 -16
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +14 -6
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +6 -1
- package/dist/components/toast.js +17 -9
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -5
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +15 -6
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +264 -114
- package/dist/semantic.js +437 -282
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +13 -7
- package/src/definitions/behaviors/form.js +31 -23
- package/src/definitions/behaviors/state.js +22 -19
- package/src/definitions/behaviors/visibility.js +14 -5
- package/src/definitions/collections/breadcrumb.less +2 -1
- package/src/definitions/collections/form.less +26 -5
- package/src/definitions/collections/grid.less +2 -1
- package/src/definitions/collections/menu.less +29 -21
- package/src/definitions/collections/message.less +2 -1
- package/src/definitions/collections/table.less +2 -1
- package/src/definitions/elements/button.less +3 -1
- package/src/definitions/elements/container.less +2 -1
- package/src/definitions/elements/divider.less +2 -1
- package/src/definitions/elements/emoji.less +2 -1
- package/src/definitions/elements/flag.less +2 -1
- package/src/definitions/elements/header.less +2 -1
- package/src/definitions/elements/icon.less +2 -1
- package/src/definitions/elements/image.less +2 -1
- package/src/definitions/elements/input.less +2 -1
- package/src/definitions/elements/label.less +23 -2
- package/src/definitions/elements/list.less +2 -1
- package/src/definitions/elements/loader.less +2 -1
- package/src/definitions/elements/placeholder.less +2 -1
- package/src/definitions/elements/rail.less +2 -1
- package/src/definitions/elements/reveal.less +2 -1
- package/src/definitions/elements/segment.less +37 -11
- package/src/definitions/elements/step.less +2 -1
- package/src/definitions/elements/text.less +2 -1
- package/src/definitions/globals/reset.less +2 -1
- package/src/definitions/globals/site.less +2 -1
- package/src/definitions/modules/accordion.js +0 -4
- package/src/definitions/modules/accordion.less +2 -1
- package/src/definitions/modules/calendar.js +0 -5
- package/src/definitions/modules/calendar.less +3 -2
- package/src/definitions/modules/checkbox.js +0 -4
- package/src/definitions/modules/checkbox.less +2 -1
- package/src/definitions/modules/dimmer.js +0 -4
- package/src/definitions/modules/dimmer.less +2 -1
- package/src/definitions/modules/dropdown.js +28 -13
- package/src/definitions/modules/dropdown.less +22 -2
- package/src/definitions/modules/embed.js +0 -5
- package/src/definitions/modules/embed.less +2 -1
- package/src/definitions/modules/flyout.js +39 -26
- package/src/definitions/modules/flyout.less +2 -1
- package/src/definitions/modules/modal.js +43 -31
- package/src/definitions/modules/modal.less +7 -3
- package/src/definitions/modules/nag.js +15 -7
- package/src/definitions/modules/nag.less +3 -1
- package/src/definitions/modules/popup.js +24 -16
- package/src/definitions/modules/popup.less +42 -39
- package/src/definitions/modules/progress.js +0 -5
- package/src/definitions/modules/progress.less +2 -1
- package/src/definitions/modules/rating.js +0 -4
- package/src/definitions/modules/rating.less +2 -1
- package/src/definitions/modules/search.js +2 -5
- package/src/definitions/modules/search.less +2 -1
- package/src/definitions/modules/shape.js +0 -4
- package/src/definitions/modules/shape.less +2 -1
- package/src/definitions/modules/sidebar.js +14 -7
- package/src/definitions/modules/sidebar.less +2 -1
- package/src/definitions/modules/slider.js +121 -30
- package/src/definitions/modules/slider.less +2 -1
- package/src/definitions/modules/sticky.js +16 -15
- package/src/definitions/modules/sticky.less +2 -1
- package/src/definitions/modules/tab.js +13 -5
- package/src/definitions/modules/tab.less +2 -1
- package/src/definitions/modules/toast.js +16 -8
- package/src/definitions/modules/toast.less +9 -1
- package/src/definitions/modules/transition.js +0 -4
- package/src/definitions/modules/transition.less +2 -1
- package/src/definitions/views/ad.less +2 -1
- package/src/definitions/views/card.less +2 -1
- package/src/definitions/views/comment.less +2 -1
- package/src/definitions/views/feed.less +2 -1
- package/src/definitions/views/item.less +2 -1
- package/src/definitions/views/statistic.less +2 -1
- package/src/overrides.less +7 -0
- package/src/theme.less +7 -6
- package/src/themes/default/elements/label.variables +5 -0
- package/src/themes/default/elements/segment.variables +4 -0
- package/src/themes/default/globals/site.variables +3 -0
- package/src/themes/default/modules/dropdown.variables +3 -0
- package/src/themes/default/modules/modal.variables +1 -0
- package/src/themes/default/modules/popup.variables +3 -1
- package/src/themes/default/modules/toast.variables +1 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.11+980ea5e
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(
|
11
|
+
!function(W,e,Y){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,W.fn.shape=function(m){var v,b=W(this),x=Date.now(),y=[],C=m,S="string"==typeof C,w=[].slice.call(arguments,1);return b.each(function(){var i,n,a=W.isPlainObject(m)?W.extend(!0,{},W.fn.shape.settings,m):W.extend({},W.fn.shape.settings),e=a.namespace,r=a.selector,d=a.error,s=a.className,t="."+e,o="module-"+e,l=W(this),c=l.find(">"+r.sides),u=c.find(">"+r.side),f=!1,g=this,h=l.data(o),p={initialize:function(){p.verbose("Initializing module for",g),p.set.defaultSide(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),h=p,l.data(o,h)},destroy:function(){p.verbose("Destroying previous module for",g),l.removeData(o).off(t)},refresh:function(){p.verbose("Refreshing selector cache for",g),l=W(g),c=W(this).find(r.sides),u=W(this).find(r.side)},repaint:function(){p.verbose("Forcing repaint event");(c[0]||Y.createElement("div")).offsetWidth},animate:function(e,t){p.verbose("Animating box with properties",e),t=t||function(e){p.verbose("Executing animation callback"),void 0!==e&&e.stopPropagation(),p.reset(),p.set.active()},a.onBeforeChange.call(n[0]),p.verbose("Starting CSS animation"),l.addClass(s.animating),c.css(e).one("transitionend",t),p.set.duration(a.duration),requestAnimationFrame(function(){l.addClass(s.animating),i.addClass(s.hidden)})},queue:function(e){p.debug("Queueing animation of",e),c.one("transitionend",function(){p.debug("Executing queued animation"),setTimeout(function(){l.shape(e)},0)})},reset:function(){p.verbose("Animating states reset"),l.removeClass(s.animating).attr("style","").removeAttr("style"),c.attr("style","").removeAttr("style"),u.attr("style","").removeAttr("style").removeClass(s.hidden),n.removeClass(s.animating).attr("style","").removeAttr("style")},is:{complete:function(){return u.filter("."+s.active)[0]===n[0]},animating:function(){return l.hasClass(s.animating)},hidden:function(){return 0<l.closest(":hidden").length}},set:{defaultSide:function(){i=u.filter("."+a.className.active),n=0<i.next(r.side).length?i.next(r.side):u.first(),f=!1,p.verbose("Active side set to",i),p.verbose("Next side set to",n)},duration:function(e){e=e||a.duration,p.verbose("Setting animation duration",e="number"==typeof e?e+"ms":e),!a.duration&&0!==a.duration||c.add(u).css({"transition-duration":e})},currentStageSize:function(){var e=u.filter("."+a.className.active),t=e.outerWidth(!0),e=e.outerHeight(!0);l.css({width:t,height:e})},stageSize:function(){var e=l.clone().addClass(s.loading),t=e.find(">"+r.sides+">"+r.side),i=t.filter("."+a.className.active),t=f?t.eq(f):0<i.next(r.side).length?i.next(r.side):t.first(),n="next"===a.width?t.outerWidth(!0):"initial"===a.width?l.width():a.width,o="next"===a.height?t.outerHeight(!0):"initial"===a.height?l.height():a.height;i.removeClass(s.active),t.addClass(s.active),e.insertAfter(l),e.remove(),"auto"!==a.width&&(l.css("width",n+a.jitter),p.verbose("Specifying width during animation",n)),"auto"!==a.height&&(l.css("height",o+a.jitter),p.verbose("Specifying height during animation",o))},nextSide:function(e){f=e,n=u.filter(e),f=u.index(n),0===n.length&&(p.set.defaultSide(),p.error(d.side)),p.verbose("Next side manually set to",n)},active:function(){p.verbose("Setting new side to active",n),u.removeClass(s.active),n.addClass(s.active),a.onChange.call(n[0]),p.set.defaultSide()}},flip:{to:function(e,t){var i;p.is.hidden()?p.debug("Module not visible",n):!p.is.complete()||p.is.animating()||a.allowRepeats?(i=p.get.transform[e](),p.is.animating()?p.queue("flip "+e):(p.debug("Flipping "+e,n),p.set.stageSize(),p.stage[t](),p.animate(i))):p.debug("Side already visible",n)},up:function(){p.flip.to("up","above")},down:function(){p.flip.to("down","below")},left:function(){p.flip.to("left","left")},right:function(){p.flip.to("right","right")},over:function(){p.flip.to("over","behind")},back:function(){p.flip.to("back","behind")}},get:{transform:{up:function(){var e=i.outerHeight(!0)/2;return{transform:"translateY("+(n.outerHeight(!0)-e)+"px) translateZ(-"+e+"px) rotateX(-90deg)"}},down:function(){var e=i.outerHeight(!0)/2;return{transform:"translateY(-"+e+"px) translateZ(-"+e+"px) rotateX(90deg)"}},left:function(){var e=i.outerWidth(!0)/2;return{transform:"translateX("+(n.outerWidth(!0)-e)+"px) translateZ(-"+e+"px) rotateY(90deg)"}},right:function(){var e=i.outerWidth(!0)/2;return{transform:"translateX(-"+e+"px) translateZ(-"+e+"px) rotateY(-90deg)"}},over:function(){return{transform:"translateX("+-(i.outerWidth(!0)-n.outerWidth(!0))/2+"px) rotateY(180deg)"}},back:function(){return{transform:"translateX("+-(i.outerWidth(!0)-n.outerWidth(!0))/2+"px) rotateY(-180deg)"}}},nextSide:function(){return 0<i.next(r.side).length?i.next(r.side):u.first()}},stage:{above:function(){var e={origin:(i.outerHeight(!0)-n.outerHeight(!0))/2,depth:{active:n.outerHeight(!0)/2,next:i.outerHeight(!0)/2}};p.verbose("Setting the initial animation position as above",n,e),i.css({transform:"rotateX(0deg)"}),n.addClass(s.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px) translateY(-"+e.depth.active+"px)"})},below:function(){var e={origin:(i.outerHeight(!0)-n.outerHeight(!0))/2,depth:{active:n.outerHeight(!0)/2,next:i.outerHeight(!0)/2}};p.verbose("Setting the initial animation position as below",n,e),i.css({transform:"rotateX(0deg)"}),n.addClass(s.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px) translateY("+e.depth.active+"px)"})},left:function(){var e=i.outerWidth(!0),t=n.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as left",n,t),i.css({transform:"rotateY(0deg)"}),n.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(-90deg) translateZ("+t.depth.next+"px) translateX(-"+t.depth.active+"px)"})},right:function(){var e=i.outerWidth(!0),t=n.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as right",n,t),i.css({transform:"rotateY(0deg)"}),n.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(90deg) translateZ("+t.depth.next+"px) translateX("+t.depth.active+"px)"})},behind:function(){var e=i.outerWidth(!0),t=n.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as behind",n,t),i.css({transform:"rotateY(0deg)"}),n.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(e,t){if(p.debug("Changing setting",e,t),W.isPlainObject(e))W.extend(!0,a,e);else{if(void 0===t)return a[e];W.isPlainObject(a[e])?W.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(W.isPlainObject(e))W.extend(!0,p,e);else{if(void 0===t)return p[e];p[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,a.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),p.verbose.apply(console,arguments)))},error:function(){a.silent||(p.error=Function.prototype.bind.call(console.error,console,a.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,i;a.performance&&(i=(t=Date.now())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":i})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var e=a.name+":",i=0;x=!1,clearTimeout(p.performance.timer),W.each(y,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",1<b.length&&(e+=" ("+b.length+")"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):W.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var o,a,i,r,s=h;return e=e||w,t=t||g,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),o=n.length-1,W.each(n,function(e,t){var i=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(W.isPlainObject(s[i])&&e!==o)s=s[i];else{if(void 0!==s[i])return a=s[i],!1;{if(!W.isPlainObject(s[t])||e===o)return void 0!==s[t]?a=s[t]:p.error(d.method,n),!1;s=s[t]}}})),"function"==typeof(r=a)&&"number"!=typeof r.nodeType?i=a.apply(t,e):void 0!==a&&(i=a),Array.isArray(v)?v.push(i):void 0!==v?v=[v,i]:void 0!==i&&(v=i),a}};S?(void 0===h&&p.initialize(),0<(e=l.find("input")).length?(e.trigger("blur"),setTimeout(function(){p.invoke(C)},150)):p.invoke(C)):(void 0!==h&&h.invoke("destroy"),p.initialize())}),void 0!==v?v:this},W.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",onBeforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.11+980ea5e - Sidebar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -28,15 +28,25 @@
|
|
28
28
|
$html = $('html'),
|
29
29
|
$head = $('head'),
|
30
30
|
|
31
|
-
moduleSelector = $allModules.selector || '',
|
32
|
-
|
33
31
|
time = Date.now(),
|
34
32
|
performance = [],
|
35
33
|
|
36
34
|
query = arguments[0],
|
37
35
|
methodInvoked = typeof query === 'string',
|
38
36
|
queryArguments = [].slice.call(arguments, 1),
|
37
|
+
contextCheck = function (context, win) {
|
38
|
+
var $context;
|
39
|
+
if ([window, document].indexOf(context) >= 0) {
|
40
|
+
$context = $body;
|
41
|
+
} else {
|
42
|
+
$context = $(win.document).find(context);
|
43
|
+
if ($context.length === 0) {
|
44
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
45
|
+
}
|
46
|
+
}
|
39
47
|
|
48
|
+
return $context;
|
49
|
+
},
|
40
50
|
returnedValue;
|
41
51
|
|
42
52
|
$allModules.each(function () {
|
@@ -55,7 +65,7 @@
|
|
55
65
|
moduleNamespace = 'module-' + namespace,
|
56
66
|
|
57
67
|
$module = $(this),
|
58
|
-
$context =
|
68
|
+
$context = contextCheck(settings.context, window),
|
59
69
|
isBody = $context[0] === $body[0],
|
60
70
|
|
61
71
|
$sidebars = $module.children(selector.sidebar),
|
@@ -277,7 +287,7 @@
|
|
277
287
|
|
278
288
|
refresh: function () {
|
279
289
|
module.verbose('Refreshing selector cache');
|
280
|
-
$context =
|
290
|
+
$context = contextCheck(settings.context, window);
|
281
291
|
module.refreshSidebars();
|
282
292
|
$pusher = $context.children(selector.pusher);
|
283
293
|
$fixed = $context.children(selector.fixed);
|
@@ -901,9 +911,6 @@
|
|
901
911
|
totalTime += data['Execution Time'];
|
902
912
|
});
|
903
913
|
title += ' ' + totalTime + 'ms';
|
904
|
-
if (moduleSelector) {
|
905
|
-
title += ' \'' + moduleSelector + '\'';
|
906
|
-
}
|
907
914
|
if (performance.length > 0) {
|
908
915
|
console.groupCollapsed(title);
|
909
916
|
if (console.table) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.3-beta.
|
2
|
+
* # Fomantic UI - 2.9.3-beta.11+980ea5e
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(D,R,I){"use strict";function V(e){return"function"==typeof e&&"number"!=typeof e.nodeType}R=void 0!==R&&R.Math===Math?R:globalThis,D.fn.sidebar=function(T){var k,e=D(this),w=D(R),A=D(I),F=D("body"),O=D("html"),P=D("head"),E=e.selector||"",B=Date.now(),H=[],M=T,L="string"==typeof M,j=[].slice.call(arguments,1);return e.each(function(){var t,r,e,s,a=D.isPlainObject(T)?D.extend(!0,{},D.fn.sidebar.settings,T):D.extend({},D.fn.sidebar.settings),i=a.selector,l=a.className,n=a.namespace,o=a.regExp,c=a.error,d="."+n,u="module-"+n,f=D(this),h=[R,I].indexOf(a.context)<0?A.find(a.context):F,b=h[0]===F[0],g=f.children(i.sidebar),m=(h.children(i.fixed),h.children(i.pusher)),v=this,p=f.data(u),y="",x="",S=!1,C={initialize:function(){C.debug("Initializing sidebar",T),C.create.id(),a.delaySetup?requestAnimationFrame(C.setup.layout):C.setup.layout(),requestAnimationFrame(function(){C.setup.cache()}),C.instantiate()},instantiate:function(){C.verbose("Storing instance of module",C),p=C,f.data(u,C)},create:{id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),r="."+e,C.verbose("Creating unique id for element",e)}},destroy:function(){C.verbose("Destroying previous module for",f),f.off(d).removeData(u),C.is.ios()&&C.remove.ios(),h.off(r),w.off(r),A.off(r)},event:{clickaway:function(e){var i;a.closable&&(i=0<m.find(e.target).length||m.is(e.target),e=h.is(e.target),i&&(C.verbose("User clicked on dimmed page"),C.hide()),e&&(C.verbose("User clicked on dimmable context (scaled out page)"),C.hide()))},touch:function(e){},containScroll:function(e){v.scrollTop<=0&&(v.scrollTop=1),v.scrollTop+v.offsetHeight>=v.scrollHeight&&(v.scrollTop=v.scrollHeight-v.offsetHeight-1)},scroll:function(e){0===D(e.target).closest(i.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){C.verbose("Adding clickaway events to context",h),h.on("click"+r,C.event.clickaway).on("touchend"+r,C.event.clickaway)},scrollLock:function(){a.scrollLock&&(C.debug("Disabling page scroll"),(S=C.has.scrollbar())&&(C.save.bodyMargin(),C.set.bodyMargin()),h.addClass(l.locked)),C.verbose("Adding events to contain sidebar scroll"),A.on("touchmove"+r,C.event.touch),f.on("scroll"+d,C.event.containScroll)}},unbind:{clickaway:function(){C.verbose("Removing clickaway events from context",h),h.off(r)},scrollLock:function(){C.verbose("Removing scroll lock from page"),S&&C.restore.bodyMargin(),h.removeClass(l.locked),A.off(r),f.off("scroll"+d)}},add:{inlineCSS:function(){var e=C.cache.width||f.outerWidth(),i=C.cache.height||f.outerHeight(),n=C.is.rtl(),o=C.get.direction(),i={left:e,right:-e,top:i,bottom:-i};n&&(C.verbose("RTL detected, flipping widths"),i.left=-e,i.right=e),n="<style>","left"===o||"right"===o?(C.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+o+".sidebar ~ .fixed, .ui.visible."+o+".sidebar ~ .pusher { transform: translate3d("+i[o]+"px, 0, 0); }"):"top"!==o&&"bottom"!==o||(n+=" .ui.visible."+o+".sidebar ~ .fixed, .ui.visible."+o+".sidebar ~ .pusher { transform: translate3d(0, "+i[o]+"px, 0); }"),C.is.ie()&&("left"===o||"right"===o?(C.debug("Adding CSS rules for animation distance",e),n+=" body.pushable > .ui.visible."+o+".sidebar ~ .pusher::after { transform: translate3d("+i[o]+"px, 0, 0); }"):"top"!==o&&"bottom"!==o||(n+=" body.pushable > .ui.visible."+o+".sidebar ~ .pusher::after { transform: translate3d(0, "+i[o]+"px, 0); }"),n+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after { transform: translate3d(0, 0, 0); }"),t=D(n+="</style>").appendTo(P),C.debug("Adding sizing css to head",t)}},refresh:function(){C.verbose("Refreshing selector cache"),h=[R,I].indexOf(a.context)<0?A.find(a.context):F,C.refreshSidebars(),m=h.children(i.pusher),h.children(i.fixed),C.clear.cache()},refreshSidebars:function(){C.verbose("Refreshing other sidebars"),g=h.children(i.sidebar)},repaint:function(){C.verbose("Forcing repaint event"),v.style.display="none";v.offsetHeight;v.scrollTop=v.scrollTop,v.style.display=""},setup:{cache:function(){C.cache={width:f.outerWidth(),height:f.outerHeight()}},layout:function(){0===h.children(i.pusher).length&&(C.debug("Adding wrapper element for sidebar"),C.error(c.pusher),m=D('<div class="pusher" />'),h.children().not(i.omitted).not(g).wrapAll(m),C.refresh()),0!==f.nextAll(i.pusher).length&&f.nextAll(i.pusher)[0]===m[0]||(C.debug("Moved sidebar to correct parent element"),C.error(c.movedSidebar,v),f.detach().prependTo(h),C.refresh()),C.clear.cache(),C.set.pushable(),C.set.direction()}},attachEvents:function(e,i){var n=D(e);i=V(C[i])?C[i]:C.toggle,0<n.length?(C.debug("Attaching sidebar events to element",e,i),n.on("click"+d,i)):C.error(c.notFound,e)},can:{leftBodyScrollbar:function(){return void 0===C.cache.leftBodyScrollbar&&(C.cache.leftBodyScrollbar=C.is.rtl()&&(C.is.iframe&&!C.is.firefox()||C.is.safari()||C.is.edge()||C.is.ie())),C.cache.leftBodyScrollbar}},save:{bodyMargin:function(){y=h.css((b?"margin-":"padding-")+(C.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(y.replace(/[^\d.]/g,""),10),i=b?R.innerWidth-I.documentElement.clientWidth:h[0].offsetWidth-h[0].clientWidth;x=e+i}},show:function(e){if(e=V(e)?e:function(){},C.is.hidden())if(!1===a.onShow.call(v))C.verbose("Show callback returned false cancelling show");else{if(a.overlay&&(C.error(c.overlay),a.transition="overlay"),C.refresh(),C.othersActive())if(C.debug("Other sidebars currently visible"),a.exclusive){if("overlay"!==a.transition)return void C.hideOthers(C.show);C.hideOthers()}else a.transition="overlay";C.set.dimmerStyles(),C.pushPage(function(){e.call(v),a.onVisible.call(v)}),a.onChange.call(v)}else C.debug("Sidebar is already visible")},hide:function(e){e=V(e)?e:function(){},(C.is.visible()||C.is.animating())&&!1!==a.onHide.call(v)&&(C.debug("Hiding sidebar",e),C.refreshSidebars(),C.pullPage(function(){e.call(v),a.onHidden.call(v)}),a.onChange.call(v))},othersAnimating:function(){return 0<g.not(f).filter("."+l.animating).length},othersVisible:function(){return 0<g.not(f).filter("."+l.visible).length},othersActive:function(){return C.othersVisible()||C.othersAnimating()},hideOthers:function(e){var i=g.not(f).filter("."+l.visible),n=i.length,o=0;e=e||function(){},i.sidebar("hide",function(){++o===n&&e()})},toggle:function(){C.verbose("Determining toggled direction"),C.is.hidden()?C.show():C.hide()},pushPage:function(i){var e,n,o=C.get.transition(),t="overlay"===o||C.othersActive()?f:m;i=V(i)?i:function(){},a.returnScroll&&(s=(b?w:h).scrollTop()),"scale down"===a.transition&&C.scrollToTop(),C.bind.scrollLock(),C.set.transition(o),C.repaint(),o=function(){C.bind.clickaway(),C.add.inlineCSS(),C.set.animating(),C.set.visible()},e=function(){C.set.dimmed()},n=function(e){e.target===t[0]&&(t.off("transitionend"+r,n),C.remove.animating(),i.call(v))},t.off("transitionend"+r),t.on("transitionend"+r,n),requestAnimationFrame(o),a.dimPage&&!C.othersVisible()&&requestAnimationFrame(e)},pullPage:function(i){var e,n,o=C.get.transition(),t="overlay"===o||C.othersActive()?f:m;i=V(i)?i:function(){},C.verbose("Removing context push state",C.get.direction()),C.unbind.clickaway(),C.unbind.scrollLock(),e=function(){C.set.transition(o),C.set.animating(),a.dimPage&&!C.othersVisible()&&C.set.closing(),C.remove.visible()},n=function(e){e.target===t[0]&&(t.off("transitionend"+r,n),C.remove.animating(),C.remove.closing(),C.remove.transition(),C.remove.inlineCSS(),"scale down"!==o&&!a.returnScroll||C.scrollBack(),a.dimPage&&!C.othersVisible()&&m.removeClass(l.dimmed),i.call(v))},t.off("transitionend"+r),t.on("transitionend"+r,n),requestAnimationFrame(e)},scrollToTop:function(){C.verbose("Scrolling to top of page to avoid animation issues"),f.scrollTop(0),(b?w:h)[0].scrollTo(0,0)},scrollBack:function(){C.verbose("Scrolling back to original page position"),(b?w:h)[0].scrollTo(0,s)},clear:{cache:function(){C.verbose("Clearing cached dimensions"),C.cache={}}},set:{bodyMargin:function(){var n=C.can.leftBodyScrollbar()?"left":"right";h.css((b?"margin-":"padding-")+n,x+"px"),h.find(i.bodyFixed.replace("right",n)).each(function(){var e=D(this),i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"calc("+e.css(i)+" + "+x+"px)")})},dimmerStyles:function(){a.blurring?m.addClass(l.blurring):m.removeClass(l.blurring)},ios:function(){O.addClass(l.ios)},pushed:function(){h.addClass(l.pushed)},pushable:function(){h.addClass(l.pushable)},dimmed:function(){m.addClass(l.dimmed)},active:function(){f.addClass(l.active)},animating:function(){f.addClass(l.animating)},closing:function(){m.addClass(l.closing)},transition:function(e){e=e||C.get.transition(),f.addClass(e)},direction:function(e){e=e||C.get.direction(),f.addClass(l[e])},visible:function(){f.addClass(l.visible)},overlay:function(){f.addClass(l.overlay)}},remove:{inlineCSS:function(){C.debug("Removing inline css styles",t),t&&0<t.length&&t.remove()},ios:function(){O.removeClass(l.ios)},pushed:function(){h.removeClass(l.pushed)},pushable:function(){h.removeClass(l.pushable)},active:function(){f.removeClass(l.active)},animating:function(){f.removeClass(l.animating)},closing:function(){m.removeClass(l.closing)},transition:function(e){e=e||C.get.transition(),f.removeClass(e)},direction:function(e){e=e||C.get.direction(),f.removeClass(l[e])},visible:function(){f.removeClass(l.visible)},overlay:function(){f.removeClass(l.overlay)}},restore:{bodyMargin:function(){var n=C.can.leftBodyScrollbar()?"left":"right";h.css((b?"margin-":"padding-")+n,y),h.find(i.bodyFixed.replace("right",n)).each(function(){var e=D(this),i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"")})}},get:{direction:function(){return f.hasClass(l.top)?l.top:f.hasClass(l.right)?l.right:f.hasClass(l.bottom)?l.bottom:l.left},transition:function(){var e=C.get.direction(),e=C.is.mobile()?"auto"===a.mobileTransition?a.defaultTransition.mobile[e]:a.mobileTransition:"auto"===a.transition?a.defaultTransition.computer[e]:a.transition;return C.verbose("Determined transition",e),e}},has:{scrollbar:function(){return b||"hidden"!==h.css("overflow-y")}},is:{safari:function(){return void 0===C.cache.isSafari&&(C.cache.isSafari=/constructor/i.test(R.HTMLElement)||!!R.ApplePaySession),C.cache.isSafari},edge:function(){return void 0===C.cache.isEdge&&(C.cache.isEdge=!!R.setImmediate&&!C.is.ie()),C.cache.isEdge},firefox:function(){return void 0===C.cache.isFirefox&&(C.cache.isFirefox=!!R.InstallTrigger),C.cache.isFirefox},iframe:function(){return!(self===top)},ie:function(){var e,i;return void 0===C.cache.isIE&&(e=!R.ActiveXObject&&"ActiveXObject"in R,i="ActiveXObject"in R,C.cache.isIE=e||i),C.cache.isIE},ios:function(){var e=navigator.userAgent,i=e.match(o.ios),n=e.match(o.mobileChrome);return!(!i||n)&&(C.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(o.mobile)?(C.verbose("Browser was found to be mobile",e),!0):(C.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!C.is.visible()},visible:function(){return f.hasClass(l.visible)},open:function(){return C.is.visible()},closed:function(){return C.is.hidden()},vertical:function(){return f.hasClass(l.top)},animating:function(){return h.hasClass(l.animating)},rtl:function(){return void 0===C.cache.isRTL&&(C.cache.isRTL="rtl"===f.attr("dir")||"rtl"===f.css("direction")||"rtl"===F.attr("dir")||"rtl"===F.css("direction")||"rtl"===h.attr("dir")||"rtl"===h.css("direction")),C.cache.isRTL}},setting:function(e,i){if(C.debug("Changing setting",e,i),D.isPlainObject(e))D.extend(!0,a,e);else{if(void 0===i)return a[e];D.isPlainObject(a[e])?D.extend(!0,a[e],i):a[e]=i}},internal:function(e,i){if(D.isPlainObject(e))D.extend(!0,C,e);else{if(void 0===i)return C[e];C[e]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,a.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),C.verbose.apply(console,arguments)))},error:function(){a.silent||(C.error=Function.prototype.bind.call(console.error,console,a.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var i,n;a.performance&&(n=(i=Date.now())-(B||i),B=i,H.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var e=a.name+":",n=0;B=!1,clearTimeout(C.performance.timer),D.each(H,function(e,i){n+=i["Execution Time"]}),e+=" "+n+"ms",E&&(e+=" '"+E+"'"),0<H.length&&(console.groupCollapsed(e),console.table?console.table(H):D.each(H,function(e,i){console.log(i.Name+": "+i["Execution Time"]+"ms")}),console.groupEnd()),H=[]}},invoke:function(o,e,i){var t,r,n,s=p;return e=e||j,i=i||v,"string"==typeof o&&void 0!==s&&(o=o.split(/[ .]/),t=o.length-1,D.each(o,function(e,i){var n=e!==t?i+o[e+1].charAt(0).toUpperCase()+o[e+1].slice(1):o;if(D.isPlainObject(s[n])&&e!==t)s=s[n];else{if(void 0!==s[n])return r=s[n],!1;{if(!D.isPlainObject(s[i])||e===t)return void 0!==s[i]?r=s[i]:C.error(c.method,o),!1;s=s[i]}}})),V(r)?n=r.apply(i,e):void 0!==r&&(n=r),Array.isArray(k)?k.push(n):void 0!==k?k=[k,n]:void 0!==n&&(k=n),r}};L?(void 0===p&&C.initialize(),C.invoke(M)):(void 0!==p&&C.invoke("destroy"),C.initialize())}),void 0!==k?k:this},D.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",ios:"ios",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);
|
11
|
+
!function(D,R,I){"use strict";function V(e){return"function"==typeof e&&"number"!=typeof e.nodeType}R=void 0!==R&&R.Math===Math?R:globalThis,D.fn.sidebar=function(T){var k,e=D(this),w=D(R),A=D(I),F=D("body"),P=D("html"),E=D("head"),O=Date.now(),B=[],H=T,M="string"==typeof H,L=[].slice.call(arguments,1),j=function(e,i){var n;return 0<=[R,I].indexOf(e)?n=F:0===(n=D(i.document).find(e)).length&&(n=i.frameElement?j(e,i.parent):F),n};return e.each(function(){var o,r,e,s,a=D.isPlainObject(T)?D.extend(!0,{},D.fn.sidebar.settings,T):D.extend({},D.fn.sidebar.settings),i=a.selector,l=a.className,n=a.namespace,t=a.regExp,c=a.error,d="."+n,u="module-"+n,f=D(this),h=j(a.context,R),b=h[0]===F[0],g=f.children(i.sidebar),m=(h.children(i.fixed),h.children(i.pusher)),v=this,p=f.data(u),y="",S="",C=!1,x={initialize:function(){x.debug("Initializing sidebar",T),x.create.id(),a.delaySetup?requestAnimationFrame(x.setup.layout):x.setup.layout(),requestAnimationFrame(function(){x.setup.cache()}),x.instantiate()},instantiate:function(){x.verbose("Storing instance of module",x),p=x,f.data(u,x)},create:{id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),r="."+e,x.verbose("Creating unique id for element",e)}},destroy:function(){x.verbose("Destroying previous module for",f),f.off(d).removeData(u),x.is.ios()&&x.remove.ios(),h.off(r),w.off(r),A.off(r)},event:{clickaway:function(e){var i;a.closable&&(i=0<m.find(e.target).length||m.is(e.target),e=h.is(e.target),i&&(x.verbose("User clicked on dimmed page"),x.hide()),e&&(x.verbose("User clicked on dimmable context (scaled out page)"),x.hide()))},touch:function(e){},containScroll:function(e){v.scrollTop<=0&&(v.scrollTop=1),v.scrollTop+v.offsetHeight>=v.scrollHeight&&(v.scrollTop=v.scrollHeight-v.offsetHeight-1)},scroll:function(e){0===D(e.target).closest(i.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){x.verbose("Adding clickaway events to context",h),h.on("click"+r,x.event.clickaway).on("touchend"+r,x.event.clickaway)},scrollLock:function(){a.scrollLock&&(x.debug("Disabling page scroll"),(C=x.has.scrollbar())&&(x.save.bodyMargin(),x.set.bodyMargin()),h.addClass(l.locked)),x.verbose("Adding events to contain sidebar scroll"),A.on("touchmove"+r,x.event.touch),f.on("scroll"+d,x.event.containScroll)}},unbind:{clickaway:function(){x.verbose("Removing clickaway events from context",h),h.off(r)},scrollLock:function(){x.verbose("Removing scroll lock from page"),C&&x.restore.bodyMargin(),h.removeClass(l.locked),A.off(r),f.off("scroll"+d)}},add:{inlineCSS:function(){var e=x.cache.width||f.outerWidth(),i=x.cache.height||f.outerHeight(),n=x.is.rtl(),t=x.get.direction(),i={left:e,right:-e,top:i,bottom:-i};n&&(x.verbose("RTL detected, flipping widths"),i.left=-e,i.right=e),n="<style>","left"===t||"right"===t?(x.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!==t||(n+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d(0, "+i[t]+"px, 0); }"),x.is.ie()&&("left"===t||"right"===t?(x.debug("Adding CSS rules for animation distance",e),n+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher::after { transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!==t||(n+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher::after { transform: translate3d(0, "+i[t]+"px, 0); }"),n+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after { transform: translate3d(0, 0, 0); }"),o=D(n+="</style>").appendTo(E),x.debug("Adding sizing css to head",o)}},refresh:function(){x.verbose("Refreshing selector cache"),h=j(a.context,R),x.refreshSidebars(),m=h.children(i.pusher),h.children(i.fixed),x.clear.cache()},refreshSidebars:function(){x.verbose("Refreshing other sidebars"),g=h.children(i.sidebar)},repaint:function(){x.verbose("Forcing repaint event"),v.style.display="none";v.offsetHeight;v.scrollTop=v.scrollTop,v.style.display=""},setup:{cache:function(){x.cache={width:f.outerWidth(),height:f.outerHeight()}},layout:function(){0===h.children(i.pusher).length&&(x.debug("Adding wrapper element for sidebar"),x.error(c.pusher),m=D('<div class="pusher" />'),h.children().not(i.omitted).not(g).wrapAll(m),x.refresh()),0!==f.nextAll(i.pusher).length&&f.nextAll(i.pusher)[0]===m[0]||(x.debug("Moved sidebar to correct parent element"),x.error(c.movedSidebar,v),f.detach().prependTo(h),x.refresh()),x.clear.cache(),x.set.pushable(),x.set.direction()}},attachEvents:function(e,i){var n=D(e);i=V(x[i])?x[i]:x.toggle,0<n.length?(x.debug("Attaching sidebar events to element",e,i),n.on("click"+d,i)):x.error(c.notFound,e)},can:{leftBodyScrollbar:function(){return void 0===x.cache.leftBodyScrollbar&&(x.cache.leftBodyScrollbar=x.is.rtl()&&(x.is.iframe&&!x.is.firefox()||x.is.safari()||x.is.edge()||x.is.ie())),x.cache.leftBodyScrollbar}},save:{bodyMargin:function(){y=h.css((b?"margin-":"padding-")+(x.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(y.replace(/[^\d.]/g,""),10),i=b?R.innerWidth-I.documentElement.clientWidth:h[0].offsetWidth-h[0].clientWidth;S=e+i}},show:function(e){if(e=V(e)?e:function(){},x.is.hidden())if(!1===a.onShow.call(v))x.verbose("Show callback returned false cancelling show");else{if(a.overlay&&(x.error(c.overlay),a.transition="overlay"),x.refresh(),x.othersActive())if(x.debug("Other sidebars currently visible"),a.exclusive){if("overlay"!==a.transition)return void x.hideOthers(x.show);x.hideOthers()}else a.transition="overlay";x.set.dimmerStyles(),x.pushPage(function(){e.call(v),a.onVisible.call(v)}),a.onChange.call(v)}else x.debug("Sidebar is already visible")},hide:function(e){e=V(e)?e:function(){},(x.is.visible()||x.is.animating())&&!1!==a.onHide.call(v)&&(x.debug("Hiding sidebar",e),x.refreshSidebars(),x.pullPage(function(){e.call(v),a.onHidden.call(v)}),a.onChange.call(v))},othersAnimating:function(){return 0<g.not(f).filter("."+l.animating).length},othersVisible:function(){return 0<g.not(f).filter("."+l.visible).length},othersActive:function(){return x.othersVisible()||x.othersAnimating()},hideOthers:function(e){var i=g.not(f).filter("."+l.visible),n=i.length,t=0;e=e||function(){},i.sidebar("hide",function(){++t===n&&e()})},toggle:function(){x.verbose("Determining toggled direction"),x.is.hidden()?x.show():x.hide()},pushPage:function(i){var e,n,t=x.get.transition(),o="overlay"===t||x.othersActive()?f:m;i=V(i)?i:function(){},a.returnScroll&&(s=(b?w:h).scrollTop()),"scale down"===a.transition&&x.scrollToTop(),x.bind.scrollLock(),x.set.transition(t),x.repaint(),t=function(){x.bind.clickaway(),x.add.inlineCSS(),x.set.animating(),x.set.visible()},e=function(){x.set.dimmed()},n=function(e){e.target===o[0]&&(o.off("transitionend"+r,n),x.remove.animating(),i.call(v))},o.off("transitionend"+r),o.on("transitionend"+r,n),requestAnimationFrame(t),a.dimPage&&!x.othersVisible()&&requestAnimationFrame(e)},pullPage:function(i){var e,n,t=x.get.transition(),o="overlay"===t||x.othersActive()?f:m;i=V(i)?i:function(){},x.verbose("Removing context push state",x.get.direction()),x.unbind.clickaway(),x.unbind.scrollLock(),e=function(){x.set.transition(t),x.set.animating(),a.dimPage&&!x.othersVisible()&&x.set.closing(),x.remove.visible()},n=function(e){e.target===o[0]&&(o.off("transitionend"+r,n),x.remove.animating(),x.remove.closing(),x.remove.transition(),x.remove.inlineCSS(),"scale down"!==t&&!a.returnScroll||x.scrollBack(),a.dimPage&&!x.othersVisible()&&m.removeClass(l.dimmed),i.call(v))},o.off("transitionend"+r),o.on("transitionend"+r,n),requestAnimationFrame(e)},scrollToTop:function(){x.verbose("Scrolling to top of page to avoid animation issues"),f.scrollTop(0),(b?w:h)[0].scrollTo(0,0)},scrollBack:function(){x.verbose("Scrolling back to original page position"),(b?w:h)[0].scrollTo(0,s)},clear:{cache:function(){x.verbose("Clearing cached dimensions"),x.cache={}}},set:{bodyMargin:function(){var n=x.can.leftBodyScrollbar()?"left":"right";h.css((b?"margin-":"padding-")+n,S+"px"),h.find(i.bodyFixed.replace("right",n)).each(function(){var e=D(this),i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"calc("+e.css(i)+" + "+S+"px)")})},dimmerStyles:function(){a.blurring?m.addClass(l.blurring):m.removeClass(l.blurring)},ios:function(){P.addClass(l.ios)},pushed:function(){h.addClass(l.pushed)},pushable:function(){h.addClass(l.pushable)},dimmed:function(){m.addClass(l.dimmed)},active:function(){f.addClass(l.active)},animating:function(){f.addClass(l.animating)},closing:function(){m.addClass(l.closing)},transition:function(e){e=e||x.get.transition(),f.addClass(e)},direction:function(e){e=e||x.get.direction(),f.addClass(l[e])},visible:function(){f.addClass(l.visible)},overlay:function(){f.addClass(l.overlay)}},remove:{inlineCSS:function(){x.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},ios:function(){P.removeClass(l.ios)},pushed:function(){h.removeClass(l.pushed)},pushable:function(){h.removeClass(l.pushable)},active:function(){f.removeClass(l.active)},animating:function(){f.removeClass(l.animating)},closing:function(){m.removeClass(l.closing)},transition:function(e){e=e||x.get.transition(),f.removeClass(e)},direction:function(e){e=e||x.get.direction(),f.removeClass(l[e])},visible:function(){f.removeClass(l.visible)},overlay:function(){f.removeClass(l.overlay)}},restore:{bodyMargin:function(){var n=x.can.leftBodyScrollbar()?"left":"right";h.css((b?"margin-":"padding-")+n,y),h.find(i.bodyFixed.replace("right",n)).each(function(){var e=D(this),i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"")})}},get:{direction:function(){return f.hasClass(l.top)?l.top:f.hasClass(l.right)?l.right:f.hasClass(l.bottom)?l.bottom:l.left},transition:function(){var e=x.get.direction(),e=x.is.mobile()?"auto"===a.mobileTransition?a.defaultTransition.mobile[e]:a.mobileTransition:"auto"===a.transition?a.defaultTransition.computer[e]:a.transition;return x.verbose("Determined transition",e),e}},has:{scrollbar:function(){return b||"hidden"!==h.css("overflow-y")}},is:{safari:function(){return void 0===x.cache.isSafari&&(x.cache.isSafari=/constructor/i.test(R.HTMLElement)||!!R.ApplePaySession),x.cache.isSafari},edge:function(){return void 0===x.cache.isEdge&&(x.cache.isEdge=!!R.setImmediate&&!x.is.ie()),x.cache.isEdge},firefox:function(){return void 0===x.cache.isFirefox&&(x.cache.isFirefox=!!R.InstallTrigger),x.cache.isFirefox},iframe:function(){return!(self===top)},ie:function(){var e,i;return void 0===x.cache.isIE&&(e=!R.ActiveXObject&&"ActiveXObject"in R,i="ActiveXObject"in R,x.cache.isIE=e||i),x.cache.isIE},ios:function(){var e=navigator.userAgent,i=e.match(t.ios),n=e.match(t.mobileChrome);return!(!i||n)&&(x.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(t.mobile)?(x.verbose("Browser was found to be mobile",e),!0):(x.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!x.is.visible()},visible:function(){return f.hasClass(l.visible)},open:function(){return x.is.visible()},closed:function(){return x.is.hidden()},vertical:function(){return f.hasClass(l.top)},animating:function(){return h.hasClass(l.animating)},rtl:function(){return void 0===x.cache.isRTL&&(x.cache.isRTL="rtl"===f.attr("dir")||"rtl"===f.css("direction")||"rtl"===F.attr("dir")||"rtl"===F.css("direction")||"rtl"===h.attr("dir")||"rtl"===h.css("direction")),x.cache.isRTL}},setting:function(e,i){if(x.debug("Changing setting",e,i),D.isPlainObject(e))D.extend(!0,a,e);else{if(void 0===i)return a[e];D.isPlainObject(a[e])?D.extend(!0,a[e],i):a[e]=i}},internal:function(e,i){if(D.isPlainObject(e))D.extend(!0,x,e);else{if(void 0===i)return x[e];x[e]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,a.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),x.verbose.apply(console,arguments)))},error:function(){a.silent||(x.error=Function.prototype.bind.call(console.error,console,a.name+":"),x.error.apply(console,arguments))},performance:{log:function(e){var i,n;a.performance&&(n=(i=Date.now())-(O||i),O=i,B.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var e=a.name+":",n=0;O=!1,clearTimeout(x.performance.timer),D.each(B,function(e,i){n+=i["Execution Time"]}),e+=" "+n+"ms",0<B.length&&(console.groupCollapsed(e),console.table?console.table(B):D.each(B,function(e,i){console.log(i.Name+": "+i["Execution Time"]+"ms")}),console.groupEnd()),B=[]}},invoke:function(t,e,i){var o,r,n,s=p;return e=e||L,i=i||v,"string"==typeof t&&void 0!==s&&(t=t.split(/[ .]/),o=t.length-1,D.each(t,function(e,i){var n=e!==o?i+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(D.isPlainObject(s[n])&&e!==o)s=s[n];else{if(void 0!==s[n])return r=s[n],!1;{if(!D.isPlainObject(s[i])||e===o)return void 0!==s[i]?r=s[i]:x.error(c.method,t),!1;s=s[i]}}})),V(r)?n=r.apply(i,e):void 0!==r&&(n=r),Array.isArray(k)?k.push(n):void 0!==k?k=[k,n]:void 0!==n&&(k=n),r}};M?(void 0===p&&x.initialize(),x.invoke(H)):(void 0!==p&&x.invoke("destroy"),x.initialize())}),void 0!==k?k:this},D.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",ios:"ios",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);
|
package/dist/components/site.css
CHANGED
package/dist/components/site.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.3-beta.
|
2
|
+
* # Fomantic-UI 2.9.3-beta.11+980ea5e - Slider
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -25,8 +25,6 @@
|
|
25
25
|
$document = $(document),
|
26
26
|
$window = $(window),
|
27
27
|
|
28
|
-
moduleSelector = $allModules.selector || '',
|
29
|
-
|
30
28
|
time = Date.now(),
|
31
29
|
performance = [],
|
32
30
|
|
@@ -105,9 +103,7 @@
|
|
105
103
|
module.setup.layout();
|
106
104
|
module.setup.labels();
|
107
105
|
|
108
|
-
|
109
|
-
module.bind.events();
|
110
|
-
}
|
106
|
+
module.bind.events();
|
111
107
|
|
112
108
|
module.read.metadata();
|
113
109
|
module.read.settings();
|
@@ -139,20 +135,32 @@
|
|
139
135
|
$module.attr('tabindex', 0);
|
140
136
|
}
|
141
137
|
if ($module.find('.inner').length === 0) {
|
142
|
-
$module.append(
|
143
|
-
+
|
144
|
-
+
|
145
|
-
+
|
138
|
+
$module.append('<div class="inner">'
|
139
|
+
+ '<div class="track"></div>'
|
140
|
+
+ '<div class="track-fill"></div>'
|
141
|
+
+ '<div class="thumb"></div>'
|
146
142
|
+ '</div>');
|
147
143
|
}
|
148
144
|
precision = module.get.precision();
|
149
145
|
$thumb = $module.find('.thumb:not(.second)');
|
146
|
+
if (settings.showThumbTooltip) {
|
147
|
+
$thumb
|
148
|
+
.attr('data-position', settings.tooltipConfig.position)
|
149
|
+
.attr('data-variation', settings.tooltipConfig.variation)
|
150
|
+
;
|
151
|
+
}
|
150
152
|
$currThumb = $thumb;
|
151
153
|
if (module.is.range()) {
|
152
154
|
if ($module.find('.thumb.second').length === 0) {
|
153
|
-
$module.find('.inner').append(
|
155
|
+
$module.find('.inner').append('<div class="thumb second"></div>');
|
154
156
|
}
|
155
157
|
$secondThumb = $module.find('.thumb.second');
|
158
|
+
if (settings.showThumbTooltip) {
|
159
|
+
$secondThumb
|
160
|
+
.attr('data-position', settings.tooltipConfig.position)
|
161
|
+
.attr('data-variation', settings.tooltipConfig.variation)
|
162
|
+
;
|
163
|
+
}
|
156
164
|
}
|
157
165
|
$track = $module.find('.track');
|
158
166
|
$trackFill = $module.find('.track-fill');
|
@@ -206,9 +214,10 @@
|
|
206
214
|
for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
|
207
215
|
var
|
208
216
|
labelText = module.get.label(i),
|
209
|
-
|
217
|
+
showLabel = settings.restrictedLabels.length === 0 || settings.restrictedLabels.indexOf(labelText) >= 0,
|
218
|
+
$label = labelText !== '' && (showLabel || settings.showLabelTicks === 'always')
|
210
219
|
? (!(i % module.get.gapRatio())
|
211
|
-
? $('<li class="label">' + labelText + '</li>')
|
220
|
+
? $('<li class="label">' + (showLabel ? labelText : '') + '</li>')
|
212
221
|
: $('<li class="halftick label"></li>'))
|
213
222
|
: null,
|
214
223
|
ratio = i / len
|
@@ -352,6 +361,18 @@
|
|
352
361
|
;
|
353
362
|
$currThumb = initialPosition > newPos ? $thumb : $secondThumb;
|
354
363
|
}
|
364
|
+
if (module.is.range() && (settings.minRange || settings.maxRange)) {
|
365
|
+
var currentRangeDiff = module.get.currentRangeDiff(value),
|
366
|
+
isSecondThumb = $currThumb.hasClass('second')
|
367
|
+
;
|
368
|
+
if ((settings.minRange && currentRangeDiff < settings.minRange)
|
369
|
+
|| (settings.maxRange && currentRangeDiff > settings.maxRange)
|
370
|
+
|| (settings.preventCrossover && !isSecondThumb && value > module.secondThumbVal)
|
371
|
+
|| (settings.preventCrossover && isSecondThumb && value < module.thumbVal)
|
372
|
+
) {
|
373
|
+
return;
|
374
|
+
}
|
375
|
+
}
|
355
376
|
if (module.get.step() === 0 || module.is.smooth()) {
|
356
377
|
var
|
357
378
|
thumbVal = module.thumbVal,
|
@@ -387,6 +408,17 @@
|
|
387
408
|
return;
|
388
409
|
}
|
389
410
|
var value = module.determine.valueFromEvent(event);
|
411
|
+
if (module.is.range() && (settings.minRange || settings.maxRange)) {
|
412
|
+
if ($currThumb === undefined) {
|
413
|
+
$currThumb = value <= module.get.currentThumbValue() ? $thumb : $secondThumb;
|
414
|
+
}
|
415
|
+
var currentRangeDiff = module.get.currentRangeDiff(value);
|
416
|
+
if (settings.minRange && currentRangeDiff < settings.minRange) {
|
417
|
+
value = module.get.edgeValue(value, settings.minRange);
|
418
|
+
} else if (settings.maxRange && currentRangeDiff > settings.maxRange) {
|
419
|
+
value = module.get.edgeValue(value, settings.maxRange);
|
420
|
+
}
|
421
|
+
}
|
390
422
|
module.set.value(value);
|
391
423
|
module.unbind.slidingEvents();
|
392
424
|
touchIdentifier = undefined;
|
@@ -403,6 +435,9 @@
|
|
403
435
|
}
|
404
436
|
},
|
405
437
|
keydown: function (event, first) {
|
438
|
+
if (module.is.disabled()) {
|
439
|
+
return;
|
440
|
+
}
|
406
441
|
if (settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
|
407
442
|
$currThumb = undefined;
|
408
443
|
}
|
@@ -439,7 +474,7 @@
|
|
439
474
|
}
|
440
475
|
},
|
441
476
|
activateFocus: function (event) {
|
442
|
-
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
|
477
|
+
if (!module.is.disabled() && !module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
|
443
478
|
event.preventDefault();
|
444
479
|
module.event.keydown(event, true);
|
445
480
|
$module.trigger('focus');
|
@@ -504,7 +539,13 @@
|
|
504
539
|
|
505
540
|
is: {
|
506
541
|
range: function () {
|
507
|
-
|
542
|
+
var isRange = $module.hasClass(className.range);
|
543
|
+
if (!isRange && (settings.minRange || settings.maxRange)) {
|
544
|
+
$module.addClass(className.range);
|
545
|
+
isRange = true;
|
546
|
+
}
|
547
|
+
|
548
|
+
return isRange;
|
508
549
|
},
|
509
550
|
hover: function () {
|
510
551
|
return isHover;
|
@@ -513,23 +554,56 @@
|
|
513
554
|
return $module.is(':focus');
|
514
555
|
},
|
515
556
|
disabled: function () {
|
516
|
-
return $module.hasClass(
|
557
|
+
return $module.hasClass(className.disabled);
|
517
558
|
},
|
518
559
|
labeled: function () {
|
519
|
-
|
560
|
+
var isLabeled = $module.hasClass(className.labeled);
|
561
|
+
if (!isLabeled && (settings.restrictedLabels.length > 0 || settings.showLabelTicks !== false)) {
|
562
|
+
$module.addClass(className.labeled);
|
563
|
+
isLabeled = true;
|
564
|
+
}
|
565
|
+
|
566
|
+
return isLabeled;
|
520
567
|
},
|
521
568
|
reversed: function () {
|
522
|
-
return $module.hasClass(
|
569
|
+
return $module.hasClass(className.reversed);
|
523
570
|
},
|
524
571
|
vertical: function () {
|
525
|
-
return $module.hasClass(
|
572
|
+
return $module.hasClass(className.vertical);
|
526
573
|
},
|
527
574
|
smooth: function () {
|
528
|
-
return settings.smooth || $module.hasClass(
|
575
|
+
return settings.smooth || $module.hasClass(className.smooth);
|
529
576
|
},
|
530
577
|
},
|
531
578
|
|
532
579
|
get: {
|
580
|
+
currentRangeDiff: function (value) {
|
581
|
+
var currentRangeDiff;
|
582
|
+
if ($currThumb.hasClass('second')) {
|
583
|
+
currentRangeDiff = module.thumbVal < value
|
584
|
+
? value - module.thumbVal
|
585
|
+
: module.thumbVal - value;
|
586
|
+
} else {
|
587
|
+
currentRangeDiff = module.secondThumbVal > value
|
588
|
+
? module.secondThumbVal - value
|
589
|
+
: value - module.secondThumbVal;
|
590
|
+
}
|
591
|
+
|
592
|
+
return currentRangeDiff;
|
593
|
+
},
|
594
|
+
edgeValue: function (value, edgeValue) {
|
595
|
+
if ($currThumb.hasClass('second')) {
|
596
|
+
value = module.thumbVal < value
|
597
|
+
? module.thumbVal + edgeValue
|
598
|
+
: module.thumbVal - edgeValue;
|
599
|
+
} else {
|
600
|
+
value = module.secondThumbVal < value
|
601
|
+
? module.secondThumbVal + edgeValue
|
602
|
+
: module.secondThumbVal - edgeValue;
|
603
|
+
}
|
604
|
+
|
605
|
+
return value;
|
606
|
+
},
|
533
607
|
trackOffset: function () {
|
534
608
|
if (module.is.vertical()) {
|
535
609
|
return $track.offset().top;
|
@@ -733,13 +807,10 @@
|
|
733
807
|
return thumbDelta <= secondThumbDelta ? thumbPos : secondThumbPos;
|
734
808
|
},
|
735
809
|
thumbPos: function ($element) {
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
: (module.is.reversed() ? $element.css('right') : $element.css('left'))
|
810
|
+
return module.is.vertical()
|
811
|
+
? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
|
812
|
+
: (module.is.reversed() ? $element.css('right') : $element.css('left'))
|
740
813
|
;
|
741
|
-
|
742
|
-
return pos;
|
743
814
|
},
|
744
815
|
positionFromValue: function (val) {
|
745
816
|
var
|
@@ -763,6 +834,7 @@
|
|
763
834
|
position = Math.round(ratio * trackLength),
|
764
835
|
adjustedPos = step === 0 ? position : Math.round(position / step) * step
|
765
836
|
;
|
837
|
+
module.verbose('Determined position: ' + position + ' from ratio: ' + ratio);
|
766
838
|
|
767
839
|
return adjustedPos;
|
768
840
|
},
|
@@ -986,12 +1058,12 @@
|
|
986
1058
|
}
|
987
1059
|
if (!$currThumb.hasClass('second')) {
|
988
1060
|
if (settings.preventCrossover && module.is.range()) {
|
989
|
-
newValue = Math.min(module.secondThumbVal, newValue);
|
1061
|
+
newValue = Math.min(module.secondThumbVal - (settings.minRange || 0), newValue);
|
990
1062
|
}
|
991
1063
|
module.thumbVal = newValue;
|
992
1064
|
} else {
|
993
1065
|
if (settings.preventCrossover && module.is.range()) {
|
994
|
-
newValue = Math.max(module.thumbVal, newValue);
|
1066
|
+
newValue = Math.max(module.thumbVal + (settings.minRange || 0), newValue);
|
995
1067
|
}
|
996
1068
|
module.secondThumbVal = newValue;
|
997
1069
|
}
|
@@ -1010,6 +1082,10 @@
|
|
1010
1082
|
thumbVal = module.thumbVal || module.get.min(),
|
1011
1083
|
secondThumbVal = module.secondThumbVal || module.get.min()
|
1012
1084
|
;
|
1085
|
+
if (settings.showThumbTooltip) {
|
1086
|
+
var precision = module.get.precision();
|
1087
|
+
$targetThumb.attr('data-tooltip', Math.round(newValue * precision) / precision);
|
1088
|
+
}
|
1013
1089
|
if (module.is.range()) {
|
1014
1090
|
if (!$targetThumb.hasClass('second')) {
|
1015
1091
|
position = newPos;
|
@@ -1098,6 +1174,14 @@
|
|
1098
1174
|
settings: function () {
|
1099
1175
|
if (settings.start !== false) {
|
1100
1176
|
if (module.is.range()) {
|
1177
|
+
var rangeDiff = settings.end - settings.start;
|
1178
|
+
if (rangeDiff < 0
|
1179
|
+
|| (settings.minRange && rangeDiff < settings.minRange)
|
1180
|
+
|| (settings.maxRange && rangeDiff > settings.maxRange)
|
1181
|
+
|| (settings.minRange && settings.maxRange && settings.minRange > settings.maxRange)
|
1182
|
+
) {
|
1183
|
+
module.error(error.invalidRanges, settings.start, settings.end, settings.minRange, settings.maxRange);
|
1184
|
+
}
|
1101
1185
|
module.debug('Start position set from settings', settings.start, settings.end);
|
1102
1186
|
module.set.rangeValue(settings.start, settings.end);
|
1103
1187
|
} else {
|
@@ -1191,9 +1275,6 @@
|
|
1191
1275
|
totalTime += data['Execution Time'];
|
1192
1276
|
});
|
1193
1277
|
title += ' ' + totalTime + 'ms';
|
1194
|
-
if (moduleSelector) {
|
1195
|
-
title += ' \'' + moduleSelector + '\'';
|
1196
|
-
}
|
1197
1278
|
if (performance.length > 0) {
|
1198
1279
|
console.groupCollapsed(title);
|
1199
1280
|
if (console.table) {
|
@@ -1293,6 +1374,7 @@
|
|
1293
1374
|
error: {
|
1294
1375
|
method: 'The method you called is not defined.',
|
1295
1376
|
notrange: 'This slider is not a range slider',
|
1377
|
+
invalidRanges: 'Invalid range settings (start/end/minRange/maxRange)',
|
1296
1378
|
},
|
1297
1379
|
|
1298
1380
|
metadata: {
|
@@ -1305,6 +1387,8 @@
|
|
1305
1387
|
step: 1,
|
1306
1388
|
start: 0,
|
1307
1389
|
end: 20,
|
1390
|
+
minRange: false,
|
1391
|
+
maxRange: false,
|
1308
1392
|
labelType: 'number',
|
1309
1393
|
showLabelTicks: false,
|
1310
1394
|
smooth: false,
|
@@ -1341,6 +1425,13 @@
|
|
1341
1425
|
downArrow: 40,
|
1342
1426
|
},
|
1343
1427
|
|
1428
|
+
restrictedLabels: [],
|
1429
|
+
showThumbTooltip: false,
|
1430
|
+
tooltipConfig: {
|
1431
|
+
position: 'top center',
|
1432
|
+
variation: 'tiny black',
|
1433
|
+
},
|
1434
|
+
|
1344
1435
|
labelTypes: {
|
1345
1436
|
number: 'number',
|
1346
1437
|
letter: 'letter',
|