1 line
1.7 KiB
JavaScript
1 line
1.7 KiB
JavaScript
"use strict";var t=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),e=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=require("atom-space-pen-views"),o=n.View,r=require("atom"),a=r.CompositeDisposable,s=require("react");module.exports=function(n,r){var u={};if(u[r])return u[r];var c=function(o){function u(){i(this,u),null!=o&&o.apply(this,arguments)}return e(u,o),t(u,{detached:{value:function(){return s.unmountComponentAtNode(this[0]),this.editor.dispose(),this.disposables.dispose()}},initialize:{value:function(t){this.disposables=new a,this.editor=t,t.shouldScroll&&(this[0].style.overflow="auto");var e=s.createElement(n,{parent:this[0],editor:t,paneWidth:this[0].offsetWidth,paneHeight:this[0].offsetHeight});return this.editor.container=this[0],s.render(e,this[0]),this.disposables.add(atom.workspace.onDidChangeActivePaneItem(this.onActivePaneChange.bind(this))),atom.workspace.getActivePaneItem()===this.editor?this.onActivePaneChange(null):void 0}},onActivePaneChange:{value:function(t){return t&&t.constructor.name!==r?this.editor.active===!0?(this.editor.active=!1,this.editor.onPaneDeactivated()):void 0:(this.editor.active=!0,this.editor.onPaneActivated())}}},{content:{value:function(){return this.div({"class":r.match(/[A-Z][a-z]+/g).map(function(t){return t.toLowerCase()}).join("-")})}}}),u}(o);return u[r]=c,c}; |