mirror of
https://github.com/flarum/framework.git
synced 2025-02-17 02:02:47 +08:00
Update for component API
This commit is contained in:
parent
653f1dc841
commit
985ccc096e
|
@ -10,7 +10,7 @@ export default class AutocompleteDropdown extends Component {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import truncate from 'flarum/utils/truncate';
|
|||
import AutocompleteDropdown from 'flarum-mentions/components/autocomplete-dropdown';
|
||||
|
||||
export default function() {
|
||||
extend(ComposerBody.prototype, 'onload', function(original, element, isInitialized, context) {
|
||||
extend(ComposerBody.prototype, 'config', function(original, element, isInitialized, context) {
|
||||
if (isInitialized) return;
|
||||
|
||||
var composer = this;
|
||||
|
@ -126,7 +126,7 @@ export default function() {
|
|||
|
||||
if (suggestions.length) {
|
||||
dropdown.props.items = suggestions;
|
||||
m.render($container[0], dropdown.view());
|
||||
m.render($container[0], dropdown.render());
|
||||
|
||||
dropdown.show();
|
||||
var coordinates = getCaretCoordinates(this, mentionStart);
|
||||
|
|
Loading…
Reference in New Issue
Block a user