Skip to content

Commit ff5c2c3

Browse files
darkredMottie
authored andcommitted
(GitHub Label Color Picker) Restore functionality due to recent GitHub layout changes (#45)
* Update github-label-color-picker.user.js Restore functionality due to recent GitHub layout changes. * Update github-label-color-picker.user.js The extra `margin-left:-8px;` * Update github-label-color-picker.user.js
1 parent 6d33a09 commit ff5c2c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

github-label-color-picker.user.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// ==UserScript==
22
// @name GitHub Label Color Picker
3-
// @version 1.0.4
3+
// @version 1.0.5
44
// @description A userscript that adds a color picker to the label color input
55
// @license MIT
66
// @author Rob Garrison
7+
// @contributor darkred
78
// @namespace https://github.com/Mottie
89
// @include https://github.com/*
910
// @run-at document-idle
@@ -19,18 +20,18 @@
1920
(() => {
2021
"use strict";
2122

22-
GM_addStyle("div.cp-app { margin-top:65px; z-index:10; }");
23+
GM_addStyle("div.cp-app { margin-top:110px; margin-left:-8px; z-index:10; }");
2324

2425
function addPicker() {
25-
if (document.querySelector(".js-color-editor")) {
26-
jsColorPicker(".js-color-editor-input", {
26+
if (document.querySelector(".js-new-label-color")) {
27+
jsColorPicker(".js-new-label-color-input", {
2728
customBG: "#222",
2829
noAlpha: true,
2930
renderCallback: function(colors) {
3031
let input = this && this.input;
3132
if (input) {
3233
input.value = "#" + colors.HEX;
33-
input.previousElementSibling.style.backgroundColor = input.value;
34+
input.parentNode.previousElementSibling.style.backgroundColor = input.value;
3435
}
3536
}
3637
});

0 commit comments

Comments
 (0)