mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 17:26:38 +01:00
updates
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
/**
|
||||
* This is the base widget for all other widgets.
|
||||
*
|
||||
*
|
||||
* For information on using widgets, see the tutorial {@tutorial widget_basics}.
|
||||
*/
|
||||
class BasicWidget extends Component {
|
||||
@@ -61,7 +61,7 @@ class BasicWidget extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
this.children.sort((a, b) => a.position - b.position < 0 ? -1 : 1);
|
||||
this.children.sort((a, b) => a.position - b.position);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class BasicWidget extends Component {
|
||||
|
||||
/**
|
||||
* Accepts a string of CSS to add with the widget.
|
||||
* @param {string} block
|
||||
* @param {string} block
|
||||
* @returns {this} for chaining
|
||||
*/
|
||||
cssBlock(block) {
|
||||
@@ -112,7 +112,8 @@ class BasicWidget extends Component {
|
||||
this.doRender();
|
||||
|
||||
this.$widget.attr('data-component-id', this.componentId);
|
||||
this.$widget.addClass('component')
|
||||
this.$widget
|
||||
.addClass('component')
|
||||
.prop('component', this);
|
||||
|
||||
if (!this.isEnabled()) {
|
||||
@@ -152,9 +153,9 @@ class BasicWidget extends Component {
|
||||
|
||||
/**
|
||||
* Method used for rendering the widget.
|
||||
*
|
||||
*
|
||||
* Your class should override this method.
|
||||
* @returns {JQuery<HTMLElement>} Your widget.
|
||||
* The method is expected to create a this.$widget containing jQuery object
|
||||
*/
|
||||
doRender() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user