Fixed settings sidebar injection
This commit is contained in:
parent
2d4416466c
commit
9859064dc6
|
@ -576,8 +576,8 @@ get items(){return[{'text':'Core','id':'core'},{'text':'Emotes','id':'emotes'},{
|
|||
get component(){return BDV2.react.createElement("span",null,BDV2.react.createElement(V2Components.SideBar,{onClick:this.onClick,headerText:"BetterDiscord",items:this.items}),BDV2.react.createElement("span",{style:{fontSize:"12px",fontWeight:"600",color:"#72767d",padding:"6px 10px"}},`v${bdVersion}:${jsVersion} by `,BDV2.react.createElement("a",{href:"https://github.com/Jiiks/",target:"_blank"},"Jiiks")))}
|
||||
get root(){let _root=$("#bd-settings-sidebar");if(!_root.length){if(!this.injectRoot())return null;return this.root}
|
||||
return _root[0]}
|
||||
injectRoot(){let changeLog=$(".ui-tab-bar-item:contains('Change Log')");if(!changeLog.length)return!1;$("<span/>",{'id':'bd-settings-sidebar'}).insertBefore(changeLog.prev());return!0}
|
||||
render(){let root=this.root;if(!root){console.log("FAILED TO LOCATE ROOT: .ui-tab-bar-item:contains('Change Log')");return}
|
||||
injectRoot(){let changeLog=$(".ui-tab-bar-item:not(.danger)").last();if(!changeLog.length)return!1;$("<span/>",{'id':'bd-settings-sidebar'}).insertBefore(changeLog.prev());return!0}
|
||||
render(){let root=this.root;if(!root){console.log("FAILED TO LOCATE ROOT: .ui-tab-bar-item:not(.danger)");return}
|
||||
BDV2.reactDom.render(this.component,root)}}
|
||||
class V2_SettingsPanel{constructor(){let self=this;self.sideBarOnClick=self.sideBarOnClick.bind(self);self.onChange=self.onChange.bind(self);self.updateSettings=this.updateSettings.bind(self);self.sidebar=new V2_SettingsPanel_Sidebar(self.sideBarOnClick)}
|
||||
get root(){let _root=$("#bd-settingspane-container");if(!_root.length){if(!this.injectRoot())return null;return this.root}
|
||||
|
|
Loading…
Reference in New Issue