From 392ca4c9887de770cf8f89736edb3839d26bab26 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 4 Jan 2018 22:35:12 +0300 Subject: [PATCH] add "configure" button in the old UI --- manage.html | 1 + manage/manage.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manage.html b/manage.html index c25344d8..e0adfccf 100644 --- a/manage.html +++ b/manage.html @@ -48,6 +48,7 @@ +

diff --git a/manage/manage.js b/manage/manage.js index f41033e1..8c23d973 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -193,16 +193,19 @@ function createStyleElement({style, name, index}) { regexpsBefore: '/', regexpsAfter: '/', }, + oldConfigure: !newUI.enabled && $('.configure-usercss', entry), oldCheckUpdate: !newUI.enabled && $('.check-update', entry), oldUpdate: !newUI.enabled && $('.update', entry), }; } const parts = createStyleElement.parts; + const configurable = style.usercssData && Object.keys(style.usercssData.vars).length > 0; parts.checker.checked = style.enabled; parts.nameLink.textContent = tWordBreak(style.name); parts.nameLink.href = parts.editLink.href = parts.editHrefBase + style.id; parts.homepage.href = parts.homepage.title = style.url || ''; if (!newUI.enabled) { + parts.oldConfigure.classList.toggle('hidden', !configurable); parts.oldCheckUpdate.classList.toggle('hidden', !style.updateUrl); parts.oldUpdate.classList.toggle('hidden', !style.updateUrl); } @@ -224,7 +227,7 @@ function createStyleElement({style, name, index}) { if (style.updateUrl && newUI.enabled) { $('.actions', entry).appendChild(template.updaterIcons.cloneNode(true)); } - if (style.usercssData && Object.keys(style.usercssData.vars).length > 0 && newUI.enabled) { + if (configurable && newUI.enabled) { $('.actions', entry).appendChild(template.configureIcon.cloneNode(true)); }