cherryext/orun/extjs/static/ext-6.2.0/modern/theme-material/theme-material.js

1 line
10 KiB
JavaScript
Raw Normal View History

2018-08-17 12:14:11 +03:00
Ext.define("Ext.theme.material.Button",{override:"Ext.Button",config:{ripple:true},destroy:function(){this.callParent(arguments);this.destroyRipple()},updateHidden:function(a){this.callParent(arguments);if(a){this.removeRippleEffect()}},onPress:function(g){if(!this.getDisabled()){var k=this.getRipple();if(k){var d=window.getComputedStyle(this.element.dom).color,f=this.element.getXY(),j=this.element.getWidth(),h=this.element.getHeight(),c=j>h?j:h,i=g.getXY(),b=i[0]-f[0]-(c/2),a=i[1]-f[1]-(c/2);this.$ripple.setStyle("backgroundColor",d);this.$ripple.toggleCls("md-ripple-effect",true);this.$ripple.setWidth(c);this.$ripple.setHeight(c);this.$ripple.setTop(a);this.$ripple.setLeft(b);this.$rippleWrap.show();if(this.$rippleAnimationListener){this.$rippleAnimationListener.destroy()}this.$rippleAnimationListener=this.$ripple.on("animationend",this.onRippleEnd,this,{single:true,destroyable:true})}}this.callParent(arguments)},onRippleEnd:function(){if(this.$ripple){this.$ripple.toggleCls("md-ripple-effect",false);this.$rippleWrap.hide()}},updateRipple:function(b,a){var c=this;if(b){c.$rippleWrap=c.element.insertFirst({cls:"md-ripple-wrap"});c.$ripple=c.$rippleWrap.insertFirst({cls:"md-ripple"})}else{if(c.$ripple){c.destroyRipple()}}},removeRippleEffect:function(){if(this.$rippleAnimationListener){this.$rippleAnimationListener.destroy()}this.onRippleEnd()},destroyRipple:function(){this.removeRippleEffect();if(this.$rippleWrap){this.$rippleWrap.destroy()}},applyIconCls:function(c){var a=c&&c.match(/^md-icon[-|_](.*)/),b=a&&a.length>1?a[1]:null;if(b){return"md-icon "+c}return c}});Ext.define("Ext.theme.material.field.Field",{override:"Ext.field.Field",config:{labelAlign:"top"}});Ext.define("Ext.theme.material.MessageBox",{override:"Ext.MessageBox",config:{buttonToolbar:{layout:{pack:"end"}}}});Ext.define("Ext.theme.neptune.Titlebar",{override:"Ext.TitleBar",config:{defaultButtonUI:"alt"}});Ext.define("Ext.theme.material.TitleBar",{override:"Ext.TitleBar",config:{titleAlign:"left",defaultButtonUI:"alt"}});Ext.define("Ext.theme.material.dataview.IndexBar",{override:"Ext.dataview.IndexBar",config:{direction:"vertical",letters:["*","#","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},getElementConfig:function(){return{reference:"wrapper",classList:["x-center","x-indexbar-wrapper"],children:[{reference:"indicator",classList:["x-indexbar-indicator"],hidden:true,children:[{reference:"indicatorInner",classList:["x-indexbar-indicator-inner"]}]},this.callSuper()]}},onDragEnd:function(a,b){this.callParent([a,b]);this.indicator.hide()},privates:{onVerticalDrag:function(j,g,f){var i=this.indicator;i.show();var e=this.element,d=this.indicatorInner,b=i.getHeight(),c=b/2,a=e.getY(),h=j.y-a;h=Math.min(Math.max(h,c),e.getHeight()-c);if(f){d.setHtml(g.getHtml().toUpperCase())}i.setTop(h-c)}}});Ext.define("Ext.theme.material.dataview.List",{override:"Ext.dataview.List",config:{rowLines:false}});Ext.define("Ext.theme.material.dataview.NestedList",{override:"Ext.dataview.NestedList",config:{backText:"",useTitleAsBackText:false,backButton:{iconCls:"md-icon-arrow-back",hidden:true}}});Ext.define("Ext.theme.neptune.tip.ToolTip",{override:"Ext.tip.ToolTip",bodyBorder:false});Ext.define("Ext.theme.material.field.Checkbox",{override:"Ext.field.Checkbox",config:{labelAlign:"left",bodyAlign:"end"}});Ext.define("Ext.theme.material.form.FieldContainer",{override:"Ext.form.FieldContainer",config:{fieldSeparators:false,inputBorders:true}});Ext.define("Ext.theme.material.grid.Grid",{override:"Ext.grid.Grid",config:{rowLines:true,striped:false}});Ext.define("Ext.theme.material.navigation.Bar",{override:"Ext.navigation.Bar",config:{defaultBackButtonText:"",useTitleForBackButtonText:false,backButton:{align:"left",ui:"back",hidden:true,iconCls:"md-icon-arrow-back"}}});Ext.define("Ext.theme.material.panel.Header",{override:"Ext.panel.Header",config:{titleAlign:"left"}});Ext.define("Ext.theme.material.tab.Tab",{override:"Ext.tab.Tab",config:{iconAlign:"top",flex:1}});Ext.namespace("Ext.theme.is").Neptune=true;Ext.them