UNPKG

plumes

Version:

Flying-fast Metro future vision components

3 lines (2 loc) 1.96 kB
!function(){"use strict";window.Ractive.controller("pl-context-panel",function(e,n,o,t,i){function r(){var e=c.panel.find(".pl-group");return e.length?c.panel.find(".pl-context-panel-title, .pl-group.opened .pl-section"):c.panel.find(".pl-section")}var s=!1,u=e({plName:"pl-context-panel",data:$.extend(!0,{opened:!1,usable:!1},n),open:function(e,n,o){n=!("undefined"!=typeof n&&!n),s=o||!0,u.fire("beforeOpen",{userBehavior:n}),u.set("opened",!0),setTimeout(function(){if(u&&s){var o=r();o.each(function(e){var n=$(this);setTimeout(function(){u&&s&&n.addClass("opened")},80*e)}),setTimeout(function(){u&&s&&(u.set("usable",!0),u.fire("open",{userBehavior:n}),e&&e())},80*(o.length-1)+450)}},250)},closeContent:function(e,n){n=!("undefined"!=typeof n&&!n),s=!1,u.fire("beforeCloseContent",{userBehavior:n}),u.set("usable",!1);var o=r();o.each(function(e){var n=$(this);setTimeout(function(){u&&!s&&n.removeClass("opened")},80*(o.length-1-e))}),setTimeout(function(){u&&!s&&(u.fire("closeContent",{userBehavior:n}),e&&e())},80*(o.length-1)+450)},close:function(e,n,o){return n=!("undefined"!=typeof n&&!n),(o=o||!1)?(u.fire("beforeClose",{userBehavior:n}),u.set("opened",!1),void setTimeout(function(){u&&!s&&(u.fire("close",{userBehavior:n}),e&&e())},250)):void this.closeContent(function(){u.close(e,n,!0)},n)},groupOpened:function(e){var n=null;return c.panel.find(".pl-group.opened").each(function(){if($(this).attr("data-group")==e)return n=$(this),!1}),n},isGroupOpened:function(e){return this.groupOpened(e)||s===e},closeIfGroupOpened:function(e){var n=this.groupOpened(e);n&&u.close(function(){u.fire("closeIfGroupOpened",{$group:n,userBehavior:!1})},!1)},isOpened:function(){return u.get("opened")}}),c={panel:$(u.el)};window.Ractive.Plumes.bindUses(u,["title","leftcross","rightcross"],["leftcross","rightcross"]),u.on("cross",function(e){var n=u.get("on-cross");n&&n(e)}),u.require().then(i)})}(); //# sourceMappingURL=pl-context-panel.min.js.map