fomantic-ui 2.10.0-beta.6 → 2.10.0-beta.8
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/.eslintrc.js +0 -10
- package/README.md +4 -5
- package/changelog-setup.js +64 -70
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +94 -131
- 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 +152 -205
- 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 +1 -1
- package/dist/components/calendar.js +305 -341
- package/dist/components/calendar.min.css +1 -1
- 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 +76 -116
- 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 +58 -91
- 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 +1 -1
- package/dist/components/dropdown.js +674 -977
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +80 -127
- 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 +192 -274
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +325 -429
- package/dist/components/form.min.css +1 -1
- 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 +1 -1
- package/dist/components/label.min.css +1 -1
- 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 +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +221 -313
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +67 -97
- 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 +1 -1
- package/dist/components/popup.js +185 -254
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +103 -138
- 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 +89 -139
- 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 +253 -352
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +157 -223
- 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 +122 -163
- 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 +38 -57
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +242 -325
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +68 -98
- 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 +116 -159
- 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 +168 -233
- 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 +1 -1
- package/dist/components/toast.js +99 -132
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +86 -141
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +134 -210
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +4100 -5721
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/examples/assets/show-examples.js +2 -4
- package/gulpfile.js +5 -7
- package/package.json +1 -1
- package/scripts/nightly-version.js +7 -10
- package/src/definitions/behaviors/api.js +151 -204
- package/src/definitions/behaviors/form.js +324 -428
- package/src/definitions/behaviors/state.js +67 -97
- package/src/definitions/behaviors/visibility.js +133 -209
- package/src/definitions/globals/site.js +37 -56
- package/src/definitions/modules/accordion.js +93 -130
- package/src/definitions/modules/calendar.js +304 -340
- package/src/definitions/modules/checkbox.js +75 -115
- package/src/definitions/modules/dimmer.js +57 -90
- package/src/definitions/modules/dropdown.js +673 -976
- package/src/definitions/modules/embed.js +79 -126
- package/src/definitions/modules/flyout.js +191 -273
- package/src/definitions/modules/modal.js +220 -312
- package/src/definitions/modules/nag.js +66 -96
- package/src/definitions/modules/popup.js +184 -253
- package/src/definitions/modules/progress.js +102 -137
- package/src/definitions/modules/rating.js +88 -138
- package/src/definitions/modules/search.js +252 -351
- package/src/definitions/modules/shape.js +156 -222
- package/src/definitions/modules/sidebar.js +121 -162
- package/src/definitions/modules/slider.js +241 -324
- package/src/definitions/modules/sticky.js +115 -158
- package/src/definitions/modules/tab.js +167 -232
- package/src/definitions/modules/toast.js +98 -131
- package/src/definitions/modules/transition.js +85 -140
- package/tasks/admin/components/create.js +88 -108
- package/tasks/admin/components/init.js +26 -32
- package/tasks/admin/components/update.js +46 -53
- package/tasks/admin/distributions/create.js +71 -101
- package/tasks/admin/distributions/init.js +27 -33
- package/tasks/admin/distributions/update.js +45 -52
- package/tasks/admin/register.js +11 -15
- package/tasks/build/assets.js +14 -18
- package/tasks/build/css.js +54 -63
- package/tasks/build/javascript.js +45 -53
- package/tasks/build.js +4 -6
- package/tasks/check-install.js +5 -7
- package/tasks/clean.js +2 -4
- package/tasks/collections/admin.js +13 -15
- package/tasks/collections/build.js +6 -8
- package/tasks/collections/docs.js +2 -4
- package/tasks/collections/install.js +2 -4
- package/tasks/collections/rtl.js +2 -4
- package/tasks/collections/various.js +2 -4
- package/tasks/config/admin/github.js +7 -9
- package/tasks/config/admin/templates/css-package.js +1 -3
- package/tasks/config/admin/templates/less-package.js +1 -3
- package/tasks/config/npm/gulpfile.js +4 -6
- package/tasks/config/project/config.js +22 -30
- package/tasks/config/project/install.js +56 -70
- package/tasks/config/project/release.js +6 -8
- package/tasks/config/tasks.js +8 -12
- package/tasks/config/user.js +13 -17
- package/tasks/docs/build.js +26 -31
- package/tasks/docs/metadata.js +24 -30
- package/tasks/docs/serve.js +20 -26
- package/tasks/install.js +71 -98
- package/tasks/rtl/build.js +2 -4
- package/tasks/rtl/watch.js +2 -4
- package/tasks/watch.js +9 -11
- package/test/meteor/fonts.js +1 -2
- package/test/modules/module.spec.js +16 -18
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
2
|
+
* # Fomantic UI - 2.10.0-beta.8+62e258f
|
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(W,e,Y){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,W.fn.shape=function(m){
|
11
|
+
!function(W,e,Y){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,W.fn.shape=function(m){let v=W(this),b=Date.now(),x=[],y=m,C="string"==typeof y,S=[].slice.call(arguments,1),w;return v.each(function(){let r=W.isPlainObject(m)?W.extend(!0,{},W.fn.shape.settings,m):W.extend({},W.fn.shape.settings);var e=r.namespace;let s=r.selector,d=r.error,l=r.className,t="."+e,i="module-"+e,c=W(this),n=c.find(">"+s.sides),o=n.find(">"+s.side),u=!1,a,f,g=this,h=c.data(i),p;if(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,c.data(i,h)},destroy:function(){p.verbose("Destroying previous module for",g),c.removeData(i).off(t)},refresh:function(){p.verbose("Refreshing selector cache for",g),c=W(g),n=W(this).find(s.sides),o=W(this).find(s.side)},repaint:function(){p.verbose("Forcing repaint event");(n[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()},r.onBeforeChange.call(f[0]),p.verbose("Starting CSS animation"),c.addClass(l.animating),n.css(e).one("transitionend",t),p.set.duration(r.duration),requestAnimationFrame(function(){c.addClass(l.animating),a.addClass(l.hidden)})},queue:function(e){p.debug("Queueing animation of",e),n.one("transitionend",function(){p.debug("Executing queued animation"),setTimeout(function(){c.shape(e)},0)})},reset:function(){p.verbose("Animating states reset"),c.removeClass(l.animating).attr("style","").removeAttr("style"),n.attr("style","").removeAttr("style"),o.attr("style","").removeAttr("style").removeClass(l.hidden),f.removeClass(l.animating).attr("style","").removeAttr("style")},is:{complete:function(){return o.filter("."+l.active)[0]===f[0]},animating:function(){return c.hasClass(l.animating)},hidden:function(){return 0<c.closest(":hidden").length}},set:{defaultSide:function(){a=o.filter("."+l.active),f=0<a.next(s.side).length?a.next(s.side):o.first(),u=!1,p.verbose("Active side set to",a),p.verbose("Next side set to",f)},duration:function(e){e="number"==typeof(e=e||r.duration)?e+"ms":e,p.verbose("Setting animation duration",e),!r.duration&&0!==r.duration||n.add(o).css({"transition-duration":e})},currentStageSize:function(){let e=o.filter("."+l.active);var t=e.outerWidth(!0),i=e.outerHeight(!0);c.css({width:t,height:i})},stageSize:function(){let e=c.clone().addClass(l.loading),t=e.find(">"+s.sides+">"+s.side),i=t.filter("."+l.active),n=u?t.eq(u):0<i.next(s.side).length?i.next(s.side):t.first();var o="next"===r.width?n.outerWidth(!0):"initial"===r.width?c.width():r.width,a="next"===r.height?n.outerHeight(!0):"initial"===r.height?c.height():r.height;i.removeClass(l.active),n.addClass(l.active),e.insertAfter(c),e.remove(),"auto"!==r.width&&(c.css("width",o+r.jitter),p.verbose("Specifying width during animation",o)),"auto"!==r.height&&(c.css("height",a+r.jitter),p.verbose("Specifying height during animation",a))},nextSide:function(e){u=e,f=o.filter(e),u=o.index(f),0===f.length&&(p.set.defaultSide(),p.error(d.side)),p.verbose("Next side manually set to",f)},active:function(){p.verbose("Setting new side to active",f),o.removeClass(l.active),f.addClass(l.active),r.onChange.call(f[0]),p.set.defaultSide()}},flip:{to:function(e,t){var i;p.is.hidden()?p.debug("Module not visible",f):!p.is.complete()||p.is.animating()||r.allowRepeats?(i=p.get.transform[e](),p.is.animating()?p.queue("flip "+e):(p.debug("Flipping "+e,f),p.set.stageSize(),p.stage[t](),p.animate(i))):p.debug("Side already visible",f)},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=a.outerHeight(!0)/2;return{transform:"translateY("+(f.outerHeight(!0)-e)+"px) translateZ(-"+e+"px) rotateX(-90deg)"}},down:function(){let e=a.outerHeight(!0)/2;return{transform:"translateY(-"+e+"px) translateZ(-"+e+"px) rotateX(90deg)"}},left:function(){var e=a.outerWidth(!0)/2;return{transform:"translateX("+(f.outerWidth(!0)-e)+"px) translateZ(-"+e+"px) rotateY(90deg)"}},right:function(){let e=a.outerWidth(!0)/2;return{transform:"translateX(-"+e+"px) translateZ(-"+e+"px) rotateY(-90deg)"}},over:function(){let e=-(a.outerWidth(!0)-f.outerWidth(!0))/2;return{transform:"translateX("+e+"px) rotateY(180deg)"}},back:function(){let e=-(a.outerWidth(!0)-f.outerWidth(!0))/2;return{transform:"translateX("+e+"px) rotateY(-180deg)"}}},nextSide:function(){return 0<a.next(s.side).length?a.next(s.side):o.first()}},stage:{above:function(){var e={origin:(a.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:a.outerHeight(!0)/2}};p.verbose("Setting the initial animation position as above",f,e),a.css({transform:"rotateX(0deg)"}),f.addClass(l.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px) translateY(-"+e.depth.active+"px)"})},below:function(){var e={origin:(a.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:a.outerHeight(!0)/2}};p.verbose("Setting the initial animation position as below",f,e),a.css({transform:"rotateX(0deg)"}),f.addClass(l.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px) translateY("+e.depth.active+"px)"})},left:function(){let e=a.outerWidth(!0),t=f.outerWidth(!0);var i={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as left",f,i),a.css({transform:"rotateY(0deg)"}),f.addClass(l.animating).css({left:i.origin+"px",transform:"rotateY(-90deg) translateZ("+i.depth.next+"px) translateX(-"+i.depth.active+"px)"})},right:function(){let e=a.outerWidth(!0),t=f.outerWidth(!0);var i={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as right",f,i),a.css({transform:"rotateY(0deg)"}),f.addClass(l.animating).css({left:i.origin+"px",transform:"rotateY(90deg) translateZ("+i.depth.next+"px) translateX("+i.depth.active+"px)"})},behind:function(){let e=a.outerWidth(!0),t=f.outerWidth(!0);var i={origin:(e-t)/2,depth:{active:t/2,next:e/2}};p.verbose("Setting the initial animation position as behind",f,i),a.css({transform:"rotateY(0deg)"}),f.addClass(l.animating).css({left:i.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(e,t){if(p.debug("Changing setting",e,t),W.isPlainObject(e))W.extend(!0,r,e);else{if(void 0===t)return r[e];W.isPlainObject(r[e])?W.extend(!0,r[e],t):r[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(){!r.silent&&r.debug&&(r.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,r.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),p.verbose.apply(console,arguments)))},error:function(){r.silent||(p.error=Function.prototype.bind.call(console.error,console,r.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,i;r.performance&&(i=(t=Date.now())-(b||t),b=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":i})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(function(){p.performance.display()},500)},display:function(){let e=r.name+":",i=0;b=!1,clearTimeout(p.performance.timer),W.each(x,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",1<v.length&&(e+=" ("+v.length+")"),0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):W.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(n,e,t){let o=h,a,r,i;var s;return e=e||S,t=t||g,"string"==typeof n&&void 0!==o&&(n=n.split(/[ .]/),a=n.length-1,W.each(n,function(e,t){var i=e!==a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(W.isPlainObject(o[i])&&e!==a)o=o[i];else{if(void 0!==o[i])return r=o[i],!1;{if(!W.isPlainObject(o[t])||e===a)return void 0!==o[t]?r=o[t]:p.error(d.method,n),!1;o=o[t]}}})),"function"==typeof(s=r)&&"number"!=typeof s.nodeType?i=r.apply(t,e):void 0!==r&&(i=r),Array.isArray(w)?w.push(i):void 0!==w?w=[w,i]:void 0!==i&&(w=i),r}},C){void 0===h&&p.initialize();let e=c.find("input");0<e.length?(e.trigger("blur"),setTimeout(function(){p.invoke(y)},150)):p.invoke(y)}else void 0!==h&&h.invoke("destroy"),p.initialize()}),void 0!==w?w: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.10.0-beta.
|
2
|
+
* # Fomantic-UI 2.10.0-beta.8+62e258f - Sidebar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -20,71 +20,68 @@
|
|
20
20
|
: globalThis;
|
21
21
|
|
22
22
|
$.fn.sidebar = function (parameters) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
45
|
-
}
|
23
|
+
let $allModules = $(this);
|
24
|
+
let $window = $(window);
|
25
|
+
let $document = $(document);
|
26
|
+
let $body = $('body');
|
27
|
+
let $html = $('html');
|
28
|
+
let $head = $('head');
|
29
|
+
|
30
|
+
let time = Date.now();
|
31
|
+
let performance = [];
|
32
|
+
|
33
|
+
let query = arguments[0];
|
34
|
+
let methodInvoked = typeof query === 'string';
|
35
|
+
let queryArguments = [].slice.call(arguments, 1);
|
36
|
+
let contextCheck = function (context, win) {
|
37
|
+
let $context;
|
38
|
+
if ([window, document].indexOf(context) >= 0) {
|
39
|
+
$context = $body;
|
40
|
+
} else {
|
41
|
+
$context = $(win.document).find(context);
|
42
|
+
if ($context.length === 0) {
|
43
|
+
$context = win.frameElement ? contextCheck(context, win.parent) : $body;
|
46
44
|
}
|
45
|
+
}
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
return $context;
|
48
|
+
};
|
49
|
+
let returnedValue;
|
51
50
|
|
52
51
|
$allModules.each(function () {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
module
|
87
|
-
;
|
52
|
+
let settings = $.isPlainObject(parameters)
|
53
|
+
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
54
|
+
: $.extend({}, $.fn.sidebar.settings);
|
55
|
+
|
56
|
+
let selector = settings.selector;
|
57
|
+
let className = settings.className;
|
58
|
+
let namespace = settings.namespace;
|
59
|
+
let regExp = settings.regExp;
|
60
|
+
let error = settings.error;
|
61
|
+
|
62
|
+
let eventNamespace = '.' + namespace;
|
63
|
+
let moduleNamespace = 'module-' + namespace;
|
64
|
+
|
65
|
+
let $module = $(this);
|
66
|
+
let $context = contextCheck(settings.context, window);
|
67
|
+
let isBody = $context[0] === $body[0];
|
68
|
+
|
69
|
+
let $sidebars = $module.children(selector.sidebar);
|
70
|
+
let $fixed = $context.children(selector.fixed);
|
71
|
+
let $pusher = $context.children(selector.pusher);
|
72
|
+
let $style;
|
73
|
+
|
74
|
+
let element = this;
|
75
|
+
let instance = $module.data(moduleNamespace);
|
76
|
+
|
77
|
+
let elementNamespace;
|
78
|
+
let id;
|
79
|
+
let currentScroll;
|
80
|
+
let initialBodyMargin = '';
|
81
|
+
let tempBodyMargin = '';
|
82
|
+
let hadScrollbar = false;
|
83
|
+
|
84
|
+
let module;
|
88
85
|
|
89
86
|
module = {
|
90
87
|
|
@@ -111,8 +108,7 @@
|
|
111
108
|
module.verbose('Storing instance of module', module);
|
112
109
|
instance = module;
|
113
110
|
$module
|
114
|
-
.data(moduleNamespace, module)
|
115
|
-
;
|
111
|
+
.data(moduleNamespace, module);
|
116
112
|
},
|
117
113
|
|
118
114
|
create: {
|
@@ -127,8 +123,7 @@
|
|
127
123
|
module.verbose('Destroying previous module for', $module);
|
128
124
|
$module
|
129
125
|
.off(eventNamespace)
|
130
|
-
.removeData(moduleNamespace)
|
131
|
-
;
|
126
|
+
.removeData(moduleNamespace);
|
132
127
|
// bound by uuid
|
133
128
|
$context.off(elementNamespace);
|
134
129
|
$window.off(elementNamespace);
|
@@ -138,10 +133,8 @@
|
|
138
133
|
event: {
|
139
134
|
clickaway: function (event) {
|
140
135
|
if (settings.closable) {
|
141
|
-
|
142
|
-
|
143
|
-
clickedContext = $context.is(event.target)
|
144
|
-
;
|
136
|
+
let clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
|
137
|
+
let clickedContext = $context.is(event.target);
|
145
138
|
if (clickedInPusher) {
|
146
139
|
module.verbose('User clicked on dimmed page');
|
147
140
|
module.hide();
|
@@ -175,8 +168,7 @@
|
|
175
168
|
module.verbose('Adding clickaway events to context', $context);
|
176
169
|
$context
|
177
170
|
.on('click' + elementNamespace, module.event.clickaway)
|
178
|
-
.on('touchend' + elementNamespace, module.event.clickaway)
|
179
|
-
;
|
171
|
+
.on('touchend' + elementNamespace, module.event.clickaway);
|
180
172
|
},
|
181
173
|
scrollLock: function () {
|
182
174
|
if (settings.scrollLock) {
|
@@ -190,11 +182,9 @@
|
|
190
182
|
}
|
191
183
|
module.verbose('Adding events to contain sidebar scroll');
|
192
184
|
$document
|
193
|
-
.on('touchmove' + elementNamespace, module.event.touch)
|
194
|
-
;
|
185
|
+
.on('touchmove' + elementNamespace, module.event.touch);
|
195
186
|
$module
|
196
|
-
.on('scroll' + eventNamespace, module.event.containScroll)
|
197
|
-
;
|
187
|
+
.on('scroll' + eventNamespace, module.event.containScroll);
|
198
188
|
},
|
199
189
|
},
|
200
190
|
unbind: {
|
@@ -215,19 +205,17 @@
|
|
215
205
|
|
216
206
|
add: {
|
217
207
|
inlineCSS: function () {
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
style
|
230
|
-
;
|
208
|
+
let width = module.cache.width || $module.outerWidth();
|
209
|
+
let height = module.cache.height || $module.outerHeight();
|
210
|
+
let isRTL = module.is.rtl();
|
211
|
+
let direction = module.get.direction();
|
212
|
+
let distance = {
|
213
|
+
left: width,
|
214
|
+
right: -width,
|
215
|
+
top: height,
|
216
|
+
bottom: -height,
|
217
|
+
};
|
218
|
+
let style;
|
231
219
|
|
232
220
|
if (isRTL) {
|
233
221
|
module.verbose('RTL detected, flipping widths');
|
@@ -254,8 +242,7 @@
|
|
254
242
|
|
255
243
|
style += '</style>';
|
256
244
|
$style = $(style)
|
257
|
-
.appendTo($head)
|
258
|
-
;
|
245
|
+
.appendTo($head);
|
259
246
|
module.debug('Adding sizing css to head', $style);
|
260
247
|
},
|
261
248
|
},
|
@@ -277,7 +264,7 @@
|
|
277
264
|
repaint: function () {
|
278
265
|
module.verbose('Forcing repaint event');
|
279
266
|
element.style.display = 'none';
|
280
|
-
|
267
|
+
let ignored = element.offsetHeight;
|
281
268
|
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
282
269
|
element.style.display = '';
|
283
270
|
},
|
@@ -298,8 +285,7 @@
|
|
298
285
|
.children()
|
299
286
|
.not(selector.omitted)
|
300
287
|
.not($sidebars)
|
301
|
-
.wrapAll($pusher)
|
302
|
-
;
|
288
|
+
.wrapAll($pusher);
|
303
289
|
module.refresh();
|
304
290
|
}
|
305
291
|
if ($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
|
@@ -315,17 +301,14 @@
|
|
315
301
|
},
|
316
302
|
|
317
303
|
attachEvents: function (selector, event) {
|
318
|
-
|
319
|
-
$toggle = $(selector)
|
320
|
-
;
|
304
|
+
let $toggle = $(selector);
|
321
305
|
event = isFunction(module[event])
|
322
306
|
? module[event]
|
323
307
|
: module.toggle;
|
324
308
|
if ($toggle.length > 0) {
|
325
309
|
module.debug('Attaching sidebar events to element', selector, event);
|
326
310
|
$toggle
|
327
|
-
.on('click' + eventNamespace, event)
|
328
|
-
;
|
311
|
+
.on('click' + eventNamespace, event);
|
329
312
|
} else {
|
330
313
|
module.error(error.notFound, selector);
|
331
314
|
}
|
@@ -342,10 +325,8 @@
|
|
342
325
|
save: {
|
343
326
|
bodyMargin: function () {
|
344
327
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
345
|
-
|
346
|
-
|
347
|
-
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
|
348
|
-
;
|
328
|
+
let bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
329
|
+
let bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
349
330
|
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
350
331
|
},
|
351
332
|
},
|
@@ -416,11 +397,9 @@
|
|
416
397
|
},
|
417
398
|
|
418
399
|
hideOthers: function (callback) {
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
callbackCount = 0
|
423
|
-
;
|
400
|
+
let $otherSidebars = $sidebars.not($module).filter('.' + className.visible);
|
401
|
+
let sidebarCount = $otherSidebars.length;
|
402
|
+
let callbackCount = 0;
|
424
403
|
callback = callback || function () {};
|
425
404
|
$otherSidebars
|
426
405
|
.sidebar('hide', function () {
|
@@ -428,8 +407,7 @@
|
|
428
407
|
if (callbackCount === sidebarCount) {
|
429
408
|
callback();
|
430
409
|
}
|
431
|
-
})
|
432
|
-
;
|
410
|
+
});
|
433
411
|
},
|
434
412
|
|
435
413
|
toggle: function () {
|
@@ -442,15 +420,13 @@
|
|
442
420
|
},
|
443
421
|
|
444
422
|
pushPage: function (callback) {
|
445
|
-
|
446
|
-
|
447
|
-
$
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
transitionEnd
|
453
|
-
;
|
423
|
+
let transition = module.get.transition();
|
424
|
+
let $transition = transition === 'overlay' || module.othersActive()
|
425
|
+
? $module
|
426
|
+
: $pusher;
|
427
|
+
let animate;
|
428
|
+
let dim;
|
429
|
+
let transitionEnd;
|
454
430
|
callback = isFunction(callback)
|
455
431
|
? callback
|
456
432
|
: function () {};
|
@@ -488,14 +464,12 @@
|
|
488
464
|
},
|
489
465
|
|
490
466
|
pullPage: function (callback) {
|
491
|
-
|
492
|
-
|
493
|
-
$
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
transitionEnd
|
498
|
-
;
|
467
|
+
let transition = module.get.transition();
|
468
|
+
let $transition = transition === 'overlay' || module.othersActive()
|
469
|
+
? $module
|
470
|
+
: $pusher;
|
471
|
+
let animate;
|
472
|
+
let transitionEnd;
|
499
473
|
callback = isFunction(callback)
|
500
474
|
? callback
|
501
475
|
: function () {};
|
@@ -553,13 +527,11 @@
|
|
553
527
|
|
554
528
|
set: {
|
555
529
|
bodyMargin: function () {
|
556
|
-
|
530
|
+
let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
557
531
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
558
532
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
559
|
-
|
560
|
-
|
561
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
562
|
-
;
|
533
|
+
let el = $(this);
|
534
|
+
let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
563
535
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
564
536
|
});
|
565
537
|
},
|
@@ -653,13 +625,11 @@
|
|
653
625
|
},
|
654
626
|
restore: {
|
655
627
|
bodyMargin: function () {
|
656
|
-
|
628
|
+
let position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
657
629
|
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMargin);
|
658
630
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
659
|
-
|
660
|
-
|
661
|
-
attribute = el.css('position') === 'fixed' ? 'padding-' + position : position
|
662
|
-
;
|
631
|
+
let el = $(this);
|
632
|
+
let attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
663
633
|
el.css(attribute, '');
|
664
634
|
});
|
665
635
|
},
|
@@ -679,10 +649,8 @@
|
|
679
649
|
return className.left;
|
680
650
|
},
|
681
651
|
transition: function () {
|
682
|
-
|
683
|
-
|
684
|
-
transition
|
685
|
-
;
|
652
|
+
let direction = module.get.direction();
|
653
|
+
let transition;
|
686
654
|
transition = module.is.mobile()
|
687
655
|
? (settings.mobileTransition === 'auto'
|
688
656
|
? settings.defaultTransition.mobile[direction]
|
@@ -719,10 +687,8 @@
|
|
719
687
|
return !(self === top);
|
720
688
|
},
|
721
689
|
mobile: function () {
|
722
|
-
|
723
|
-
|
724
|
-
isMobile = userAgent.match(regExp.mobile)
|
725
|
-
;
|
690
|
+
let userAgent = navigator.userAgent;
|
691
|
+
let isMobile = userAgent.match(regExp.mobile);
|
726
692
|
if (isMobile) {
|
727
693
|
module.verbose('Browser was found to be mobile', userAgent);
|
728
694
|
|
@@ -812,11 +778,9 @@
|
|
812
778
|
},
|
813
779
|
performance: {
|
814
780
|
log: function (message) {
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
previousTime
|
819
|
-
;
|
781
|
+
let currentTime;
|
782
|
+
let executionTime;
|
783
|
+
let previousTime;
|
820
784
|
if (settings.performance) {
|
821
785
|
currentTime = Date.now();
|
822
786
|
previousTime = time || currentTime;
|
@@ -835,10 +799,8 @@
|
|
835
799
|
}, 500);
|
836
800
|
},
|
837
801
|
display: function () {
|
838
|
-
|
839
|
-
|
840
|
-
totalTime = 0
|
841
|
-
;
|
802
|
+
let title = settings.name + ':';
|
803
|
+
let totalTime = 0;
|
842
804
|
time = false;
|
843
805
|
clearTimeout(module.performance.timer);
|
844
806
|
$.each(performance, function (index, data) {
|
@@ -860,22 +822,19 @@
|
|
860
822
|
},
|
861
823
|
},
|
862
824
|
invoke: function (query, passedArguments, context) {
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
response
|
868
|
-
;
|
825
|
+
let object = instance;
|
826
|
+
let maxDepth;
|
827
|
+
let found;
|
828
|
+
let response;
|
869
829
|
passedArguments = passedArguments || queryArguments;
|
870
830
|
context = context || element;
|
871
831
|
if (typeof query === 'string' && object !== undefined) {
|
872
832
|
query = query.split(/[ .]/);
|
873
833
|
maxDepth = query.length - 1;
|
874
834
|
$.each(query, function (depth, value) {
|
875
|
-
|
835
|
+
let camelCaseValue = depth !== maxDepth
|
876
836
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
877
|
-
: query
|
878
|
-
;
|
837
|
+
: query;
|
879
838
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
880
839
|
object = object[camelCaseValue];
|
881
840
|
} else if (object[camelCaseValue] !== undefined) {
|