stuff
This commit is contained in:
parent
588df57e2e
commit
9e03932c40
|
@ -4,17 +4,13 @@ var PinDMs = (_ => {
|
||||||
return class PinDMs {
|
return class PinDMs {
|
||||||
getName () {return "PinDMs";}
|
getName () {return "PinDMs";}
|
||||||
|
|
||||||
getVersion () {return "1.6.3";}
|
getVersion () {return "1.6.4";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
getDescription () {return "Allows you to pin DMs, making them appear at the top of your DMs/Guild-list.";}
|
getDescription () {return "Allows you to pin DMs, making them appear at the top of your DMs/Guild-list.";}
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
this.changelog = {
|
|
||||||
"fixed":[["Pin Icon","Fixed Pin Icon not showing in stable and causing a crash in canary"]]
|
|
||||||
};
|
|
||||||
|
|
||||||
this.patchedModules = {
|
this.patchedModules = {
|
||||||
before: {
|
before: {
|
||||||
PrivateChannelsList: "render",
|
PrivateChannelsList: "render",
|
||||||
|
@ -327,13 +323,13 @@ var PinDMs = (_ => {
|
||||||
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.dmchannelheader, BDFDB.disCN._pindmspinnedchannelsheadercontainer, category.collapsed && BDFDB.disCN._pindmspinnedchannelsheadercollapsed, color && BDFDB.disCN._pindmspinnedchannelsheadercolored, BDFDB.disCN.namecontainernamecontainer),
|
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.dmchannelheader, BDFDB.disCN._pindmspinnedchannelsheadercontainer, category.collapsed && BDFDB.disCN._pindmspinnedchannelsheadercollapsed, color && BDFDB.disCN._pindmspinnedchannelsheadercolored, BDFDB.disCN.namecontainernamecontainer),
|
||||||
categoryId: category.id,
|
categoryId: category.id,
|
||||||
onMouseDown: event => {
|
onMouseDown: event => {
|
||||||
let node = BDFDB.DOMUtils.getParent(BDFDB.dotCN._pindmspinnedchannelsheadercontainer, event.target).cloneNode(true);
|
event = event.nativeEvent || event;
|
||||||
let mousemove = event2 => {
|
let mousemove = event2 => {
|
||||||
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
||||||
BDFDB.ListenerUtils.stopEvent(event);
|
BDFDB.ListenerUtils.stopEvent(event);
|
||||||
this.draggedCategory = category.id;
|
this.draggedCategory = category.id;
|
||||||
this.updateContainer("dmCategories");
|
this.updateContainer("dmCategories");
|
||||||
let dragpreview = this.createDragPreview(node, event2);
|
let dragpreview = this.createDragPreview(BDFDB.DOMUtils.getParent(BDFDB.dotCN._pindmspinnedchannelsheadercontainer, event.target).cloneNode(true), event2);
|
||||||
document.removeEventListener("mousemove", mousemove);
|
document.removeEventListener("mousemove", mousemove);
|
||||||
document.removeEventListener("mouseup", mouseup);
|
document.removeEventListener("mouseup", mouseup);
|
||||||
let dragging = event3 => {
|
let dragging = event3 => {
|
||||||
|
@ -502,6 +498,7 @@ var PinDMs = (_ => {
|
||||||
e.node.PinDMsMouseDownListener = event => {
|
e.node.PinDMsMouseDownListener = event => {
|
||||||
if (!BDFDB.BDUtils.isPluginEnabled("PinDMs")) e.node.removeEventListener("mousedown", e.node.PinDMsMouseDownListener);
|
if (!BDFDB.BDUtils.isPluginEnabled("PinDMs")) e.node.removeEventListener("mousedown", e.node.PinDMsMouseDownListener);
|
||||||
else {
|
else {
|
||||||
|
event = event.nativeEvent || event;
|
||||||
let mousemove = event2 => {
|
let mousemove = event2 => {
|
||||||
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
||||||
BDFDB.ListenerUtils.stopEvent(event);
|
BDFDB.ListenerUtils.stopEvent(event);
|
||||||
|
|
|
@ -73,7 +73,7 @@ var ServerFolders = (_ => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onMouseDown: (event, instance) => {
|
onMouseDown: (event, instance) => {
|
||||||
event = event.nativeEvent;
|
event = event.nativeEvent || event;
|
||||||
let mousemove = event2 => {
|
let mousemove = event2 => {
|
||||||
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
if (Math.sqrt((event.pageX - event2.pageX)**2) > 20 || Math.sqrt((event.pageY - event2.pageY)**2) > 20) {
|
||||||
BDFDB.ListenerUtils.stopEvent(event);
|
BDFDB.ListenerUtils.stopEvent(event);
|
||||||
|
|
Loading…
Reference in New Issue