You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
2.3 KiB

  1. define(["jquery","lodash","handlebars.runtime","chrome_lib","drupal-admin-drawer-templates","session"],function(p,t,i,n,r,v){var e={multi:"icon-pencil"};function s(n){return n.icon=e[n.type],n}return p.fn.tabDrawer=function(n,e){var t=this,i="open",r="active",s="in",a=t.find(".drawer"),o=t.find(".toggler"),d=t.find(".toggler."+r).first(),f="tabDrawer.opened",u="tabDrawer.closed";function c(){d.length?g(d):g(p(o.get(0))),t.addClass(i).transitionEnd(function(){t.trigger(f)})}function l(){d.removeClass(r).blur(),t.removeClass(i).transitionEnd(function(){t.trigger(u)})}function h(){(t.hasClass(i)?l:c)()}function g(n){a.removeClass(s),p(n.data("target")).addClass(s),d.length&&d.removeClass(r),n.addClass(r),d=n}if(v.isInternal()&&p("body").addClass("internal-user"),p("body").addClass("admin-drawer-loaded"),"open"!==n)return"close"===n?l():"toggle"===n?h():(o.on("click",function(n){if(n.preventDefault(),d.length&&t.hasClass(i))return d.is(p(this))?void l():void g(p(this));d=p(this),h()}),this.on("keyup",function(n){27===n.keyCode&&t.hasClass(i)&&l()})),this;if(void 0===e&&c(),"number"==typeof e){if(!t.hasClass(i))return p(o.get(e)).click(),this;t.hasClass(i)&&!d.is(p(o.get(e)))&&g(p(o.get(e)))}return this},p.fn.transitionEnd=function(n){var e="transitionend webkitTransitionEnd mozTransitionEnd oTransitionEnd MSTransitionEnd";return this.each(function(){p(this).bind(e,function(){return p(this).unbind(e),n.call(this)})})},{init:function(n){var e;i.registerHelper("slug",function(n){return n&&"string"==typeof n?n.replace(/^\s+|\s+$/g,"").toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"):n}),i.registerHelper("ifCond",function(n,e,t,i){switch(e){case"==":return n==t?i.fn(this):i.inverse(this);case"===":return n===t?i.fn(this):i.inverse(this);case"<":return n<t?i.fn(this):i.inverse(this);case"<=":return n<=t?i.fn(this):i.inverse(this);case">":return t<n?i.fn(this):i.inverse(this);case">=":return t<=n?i.fn(this):i.inverse(this);case"&&":return n&&t?i.fn(this):i.inverse(this);case"||":return n||t?i.fn(this):i.inverse(this);default:return i.inverse(this)}}),v.onInit((e=n,e=t.map(e,s),function(){if(v.isInternal()){var n=r.drupal_admin_drawer.main({data:e});p(n).prependTo("#cp-content"),p(".admin-drawer").affix({offset:{top:p("#cp-content").offset().top}}).tabDrawer()}}))}}});
  2. //# sourceMappingURL=drupal-admin-drawer.js.map