mirror of
https://github.com/flarum/core.git
synced 2025-08-01 22:20:21 +02:00
Update for component API
This commit is contained in:
@@ -10,7 +10,7 @@ export default class AutocompleteDropdown extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
view() {
|
view() {
|
||||||
return m('ul.dropdown-menu.mentions-dropdown', {config: this.element}, this.props.items.map(item => m('li', item)));
|
return m('ul.dropdown-menu.mentions-dropdown', this.props.items.map(item => m('li', item)));
|
||||||
}
|
}
|
||||||
|
|
||||||
show(left, top) {
|
show(left, top) {
|
||||||
|
@@ -10,7 +10,7 @@ import truncate from 'flarum/utils/truncate';
|
|||||||
import AutocompleteDropdown from 'flarum-mentions/components/autocomplete-dropdown';
|
import AutocompleteDropdown from 'flarum-mentions/components/autocomplete-dropdown';
|
||||||
|
|
||||||
export default function() {
|
export default function() {
|
||||||
extend(ComposerBody.prototype, 'onload', function(original, element, isInitialized, context) {
|
extend(ComposerBody.prototype, 'config', function(original, element, isInitialized, context) {
|
||||||
if (isInitialized) return;
|
if (isInitialized) return;
|
||||||
|
|
||||||
var composer = this;
|
var composer = this;
|
||||||
@@ -126,7 +126,7 @@ export default function() {
|
|||||||
|
|
||||||
if (suggestions.length) {
|
if (suggestions.length) {
|
||||||
dropdown.props.items = suggestions;
|
dropdown.props.items = suggestions;
|
||||||
m.render($container[0], dropdown.view());
|
m.render($container[0], dropdown.render());
|
||||||
|
|
||||||
dropdown.show();
|
dropdown.show();
|
||||||
var coordinates = getCaretCoordinates(this, mentionStart);
|
var coordinates = getCaretCoordinates(this, mentionStart);
|
||||||
|
Reference in New Issue
Block a user