提交 fc3b5bec 编写于 作者: shuzheng5201314's avatar shuzheng5201314

选项卡右键菜单增加material风格

上级 9ebaa66c
!function(t){function n(e){if(o[e])return o[e].exports;var i=o[e]={exports:{},id:e,loaded:!1};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=t,n.c=o,n.p="",n(0)}([function(t,n,o){window.BootstrapMenu=o(1)},function(t,n,o){"use strict";function e(t){var n=f('<div class="dropdown bootstrapMenu" style="z-index:10000;position:absolute;" />'),o=f('<ul class="dropdown-menu" style="position:static;display:block;font-size:0.9em;" />'),e=[];e[0]=[],p.each(t.options.actionsGroups,function(t,n){e[n+1]=[]});var i=!1;p.each(t.options.actions,function(n,o){var r=!1;p.each(t.options.actionsGroups,function(t,n){p.contains(t,o)&&(e[n+1].push(o),r=!0)}),r===!1&&e[0].push(o),"undefined"!=typeof n.iconClass&&(i=!0)});var r=!0;return p.each(e,function(n){0!=n.length&&(r===!1&&o.append('<li class="divider"></li>'),r=!1,p.each(n,function(n){var e=t.options.actions[n];i===!0?o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem"><i class="fa fa-fw fa-lg '+(e.iconClass||"")+'"></i> <span class="actionName"></span></a></li>'):o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem"><span class="actionName"></span></a></li>')}),o.append('<li role="presentation" class="noActionsMessage disabled"><a href="#" role="menuitem"><span>'+t.options.noActionsMessage+"</span></a></li>"))}),n.append(o)}function i(t){var n=null;switch(t.options.menuEvent){case"click":n="click";break;case"right-click":n="contextmenu";break;case"hover":n="mouseenter";break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on(n+t.namespace,t.selector,function(n){var o=f(this);return t.open(o,n),!1})}function r(t){t.$container.off(t.namespace)}function s(t){var n=t.options._actionSelectEvent+t.namespace;t.$menu.on(n,function(n){n.preventDefault(),n.stopPropagation();var o=f(n.target),e=o.closest("[data-action]");if(e&&e.length&&!e.is(".disabled")){var i=e.data("action"),r=t.options.fetchElementData(t.$openTarget);t.options.actions[i].onClick(r),t.close()}})}function c(t){t.$menu.off(t.namespace)}function a(t){switch(t.options.menuEvent){case"click":break;case"right-click":break;case"hover":var n=t.$openTarget.add(t.$menu);n.on("mouseleave"+t.closeNamespace,function(o){var e=o.toElement||o.relatedTarget;t.$openTarget.is(e)||t.$menu.is(e)||(n.off(t.closeNamespace),t.close())});break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on("click"+t.closeNamespace,function(){t.close()})}function u(t){t.$container.off(t.closeNamespace)}var l=o(2),f=o(3);o(4);var p=function(){throw new Error("Custom lodash build for BootstrapMenu. lodash chaining is not included")};p.noop=o(6),p.each=o(7),p.contains=o(34),p.extend=o(42),p.uniqueId=o(49),p.isFunction=o(19);var h={container:"body",fetchElementData:p.noop,menuSource:"mouse",menuPosition:"belowLeft",menuEvent:"right-click",actionsGroups:[],noActionsMessage:"No available actions",_actionSelectEvent:"click"},d=function(t,n){this.selector=t,this.options=p.extend({},h,n),this.namespace=p.uniqueId(".BootstrapMenu_"),this.closeNamespace=p.uniqueId(".BootstrapMenuClose_"),this.init()},v=[];d.prototype.init=function(){this.$container=f(this.options.container),this.$menu=e(this),this.$menuList=this.$menu.children(),this.$menu.hide().appendTo(this.$container),this.$openTarget=null,this.openEvent=null,i(this),s(this),v.push(this)},d.prototype.updatePosition=function(){var t=null,n=null,o=null;switch(this.options.menuSource){case"element":n=this.$openTarget;break;case"mouse":n=this.openEvent;break;default:throw new Error("Unknown BootstrapMenu 'menuSource' option")}switch(this.options.menuPosition){case"belowRight":t="right top",o="right bottom";break;case"belowLeft":t="left top",o="left bottom";break;case"aboveRight":t="right bottom",o="right top";break;case"aboveLeft":t="left bottom",o="left top";break;default:throw new Error("Unknown BootstrapMenu 'menuPosition' option")}this.$menu.css({display:"block"}),this.$menu.css({height:this.$menuList.height(),width:this.$menuList.width()}),this.$menu.position({my:t,at:o,of:n})},d.prototype.open=function(t,n){var o=this;d.closeAll(),this.$openTarget=t,this.openEvent=n;var e=o.options.fetchElementData(o.$openTarget),i=this.$menu.find("[data-action]"),r=this.$menu.find(".noActionsMessage");i.show(),r.hide();var s=0;i.each(function(){var t=f(this),n=t.data("action"),i=o.options.actions[n],r=i.classNames||null;return r&&p.isFunction(r)&&(r=r(e)),t.attr("class",l(r||"")),i.isShown&&i.isShown(e)===!1?void t.hide():(s++,t.find(".actionName").html(p.isFunction(i.name)&&i.name(e)||i.name),void(i.isEnabled&&i.isEnabled(e)===!1&&t.addClass("disabled")))}),0===s&&r.show(),this.updatePosition(),this.$menu.show(),a(this)},d.prototype.close=function(){this.$menu.hide(),u(this)},d.prototype.destroy=function(){this.close(),r(this),c(this)},d.closeAll=function(){p.each(v,function(t){t.close()})},t.exports=d},function(t,n,o){var e,i;/*!
!function(t){function n(e){if(o[e])return o[e].exports;var i=o[e]={exports:{},id:e,loaded:!1};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=t,n.c=o,n.p="",n(0)}([function(t,n,o){window.BootstrapMenu=o(1)},function(t,n,o){"use strict";function e(t){var n=f('<div class="dropdown bootstrapMenu" style="z-index:10000;position:absolute;" />'),o=f('<ul class="dropdown-menu" style="position:static;display:block;font-size:0.9em;" />'),e=[];e[0]=[],p.each(t.options.actionsGroups,function(t,n){e[n+1]=[]});var i=!1;p.each(t.options.actions,function(n,o){var r=!1;p.each(t.options.actionsGroups,function(t,n){p.contains(t,o)&&(e[n+1].push(o),r=!0)}),r===!1&&e[0].push(o),"undefined"!=typeof n.iconClass&&(i=!0)});var r=!0;return p.each(e,function(n){0!=n.length&&(r===!1&&o.append('<li class="divider"></li>'),r=!1,p.each(n,function(n){var e=t.options.actions[n];i===!0?o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem" class="waves-effect"><i class="fa fa-fw fa-lg '+(e.iconClass||"")+'"></i> <span class="actionName"></span></a></li>'):o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem" class="waves-effect"><span class="actionName"></span></a></li>')}),o.append('<li role="presentation" class="noActionsMessage disabled"><a href="#" role="menuitem" class="waves-effect"><span>'+t.options.noActionsMessage+"</span></a></li>"))}),n.append(o)}function i(t){var n=null;switch(t.options.menuEvent){case"click":n="click";break;case"right-click":n="contextmenu";break;case"hover":n="mouseenter";break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on(n+t.namespace,t.selector,function(n){var o=f(this);return t.open(o,n),!1})}function r(t){t.$container.off(t.namespace)}function s(t){var n=t.options._actionSelectEvent+t.namespace;t.$menu.on(n,function(n){n.preventDefault(),n.stopPropagation();var o=f(n.target),e=o.closest("[data-action]");if(e&&e.length&&!e.is(".disabled")){var i=e.data("action"),r=t.options.fetchElementData(t.$openTarget);t.options.actions[i].onClick(r),t.close()}})}function c(t){t.$menu.off(t.namespace)}function a(t){switch(t.options.menuEvent){case"click":break;case"right-click":break;case"hover":var n=t.$openTarget.add(t.$menu);n.on("mouseleave"+t.closeNamespace,function(o){var e=o.toElement||o.relatedTarget;t.$openTarget.is(e)||t.$menu.is(e)||(n.off(t.closeNamespace),t.close())});break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on("click"+t.closeNamespace,function(){t.close()})}function u(t){t.$container.off(t.closeNamespace)}var l=o(2),f=o(3);o(4);var p=function(){throw new Error("Custom lodash build for BootstrapMenu. lodash chaining is not included")};p.noop=o(6),p.each=o(7),p.contains=o(34),p.extend=o(42),p.uniqueId=o(49),p.isFunction=o(19);var h={container:"body",fetchElementData:p.noop,menuSource:"mouse",menuPosition:"belowLeft",menuEvent:"right-click",actionsGroups:[],noActionsMessage:"No available actions",_actionSelectEvent:"click"},d=function(t,n){this.selector=t,this.options=p.extend({},h,n),this.namespace=p.uniqueId(".BootstrapMenu_"),this.closeNamespace=p.uniqueId(".BootstrapMenuClose_"),this.init()},v=[];d.prototype.init=function(){this.$container=f(this.options.container),this.$menu=e(this),this.$menuList=this.$menu.children(),this.$menu.hide().appendTo(this.$container),this.$openTarget=null,this.openEvent=null,i(this),s(this),v.push(this)},d.prototype.updatePosition=function(){var t=null,n=null,o=null;switch(this.options.menuSource){case"element":n=this.$openTarget;break;case"mouse":n=this.openEvent;break;default:throw new Error("Unknown BootstrapMenu 'menuSource' option")}switch(this.options.menuPosition){case"belowRight":t="right top",o="right bottom";break;case"belowLeft":t="left top",o="left bottom";break;case"aboveRight":t="right bottom",o="right top";break;case"aboveLeft":t="left bottom",o="left top";break;default:throw new Error("Unknown BootstrapMenu 'menuPosition' option")}this.$menu.css({display:"block"}),this.$menu.css({height:this.$menuList.height(),width:this.$menuList.width()}),this.$menu.position({my:t,at:o,of:n})},d.prototype.open=function(t,n){var o=this;d.closeAll(),this.$openTarget=t,this.openEvent=n;var e=o.options.fetchElementData(o.$openTarget),i=this.$menu.find("[data-action]"),r=this.$menu.find(".noActionsMessage");i.show(),r.hide();var s=0;i.each(function(){var t=f(this),n=t.data("action"),i=o.options.actions[n],r=i.classNames||null;return r&&p.isFunction(r)&&(r=r(e)),t.attr("class",l(r||"")),i.isShown&&i.isShown(e)===!1?void t.hide():(s++,t.find(".actionName").html(p.isFunction(i.name)&&i.name(e)||i.name),void(i.isEnabled&&i.isEnabled(e)===!1&&t.addClass("disabled")))}),0===s&&r.show(),this.updatePosition(),this.$menu.show(),a(this)},d.prototype.close=function(){this.$menu.hide(),u(this)},d.prototype.destroy=function(){this.close(),r(this),c(this)},d.closeAll=function(){p.each(v,function(t){t.close()})},t.exports=d},function(t,n,o){var e,i;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册