Some time ago, I created a theme called Allure, but I stopped updating it for a long time due to being too busy. Recently, while reviewing the code, I discovered that this theme has some style errors in the new version of TriliumNext, and it indicates that this theme is an old theme. I'm not sure how to make this theme new, but that's not the most important issue. I've realized that many functions that were previously implemented using CSS can be better implemented using JavaScript, so I'd like to spend some time migrating the theme.
A typical example is changing the position of elements. For instance, I want to move the child element .bx-dock-right of .title-row into .ribbon-tab-container and make it the first element. To do this, I wrote my own version based on the JavaScript for wordCount and added #run=frontendStartup #widget to the attributes.
class MoveElementPlugin extends api.NoteContextAwareWidget {
get parentWidget() { return 'center-pane'; }
moveDockRightElement() {
const $dockRight = $('.bx-dock-right');
const $ribbonTabContainer = $('.ribbon-tab-container');
const $firstRibbonTab = $ribbonTabContainer.children().first();
$dockRight.insertBefore($firstRibbonTab);
}
}
module.exports = new MoveElementPlugin();
This seems impossible. Where did I go wrong?
Some time ago, I created a theme called Allure, but I stopped updating it for a long time due to being too busy. Recently, while reviewing the code, I discovered that this theme has some style errors in the new version of TriliumNext, and it indicates that this theme is an old theme. I'm not sure how to make this theme new, but that's not the most important issue. I've realized that many functions that were previously implemented using CSS can be better implemented using JavaScript, so I'd like to spend some time migrating the theme.
A typical example is changing the position of elements. For instance, I want to move the child element
.bx-dock-rightof.title-rowinto.ribbon-tab-containerand make it the first element. To do this, I wrote my own version based on the JavaScript for wordCount and added#run=frontendStartup #widgetto the attributes.This seems impossible. Where did I go wrong?