Insert batch lock button after the duplicate button
Before it was placed after the read/unread toggle button, but this
caused a minor bug.
Fixes: #51
Change-Id: Ibe9ed8db3a90b1a9f8519a32773f9d4e243c2ed4
diff --git a/src/content_scripts/console_inject.js b/src/content_scripts/console_inject.js
index c8fe462..670080f 100644
--- a/src/content_scripts/console_inject.js
+++ b/src/content_scripts/console_inject.js
@@ -231,8 +231,15 @@
modal.classList.add('visible', 'modal');
modal.style.display = 'flex';
});
- readToggle.parentNode.insertBefore(
- clone, (readToggle.nextSibling || readToggle));
+
+ var duplicateBtn =
+ readToggle.parentNode.querySelector('[debugid="mark-duplicate-button"]');
+ if (duplicateBtn)
+ duplicateBtn.parentNode.insertBefore(
+ clone, (duplicateBtn.nextSibling || duplicateBtn));
+ else
+ readToggle.parentNode.insertBefore(
+ clone, (readToggle.nextSibling || readToggle));
}
// TODO(avm99963): This is a prototype. DON'T FORGET TO ADD ERROR HANDLING.
@@ -832,6 +839,7 @@
if (options.batchlock) {
injectScript(chrome.runtime.getURL('injections/batchlock_inject.js'));
+ injectStylesheet(chrome.runtime.getURL('injections/batchlock_inject.css'));
}
if (options.threadlistavatars) {
diff --git a/src/injections/batchlock_inject.css b/src/injections/batchlock_inject.css
new file mode 100644
index 0000000..da50618
--- /dev/null
+++ b/src/injections/batchlock_inject.css
@@ -0,0 +1,3 @@
+material-button[debugid="batchlock"] {
+ padding-left: 0;
+}
diff --git a/templates/manifest.gjson b/templates/manifest.gjson
index 6f25516..2a7c440 100644
--- a/templates/manifest.gjson
+++ b/templates/manifest.gjson
@@ -68,6 +68,7 @@
"injections/profileindicator_inject.css",
"injections/ccdarktheme.css",
"injections/batchlock_inject.js",
+ "injections/batchlock_inject.css",
"injections/enhanced_announcements_dot.css",
"injections/reposition_expand_thread.css",
"injections/thread_list_avatars.css",