mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 06:39:57 +08:00
Prevent incorrect badge redraw diffing
This commit is contained in:
@ -6,10 +6,12 @@ export default class Badge extends Component {
|
|||||||
var iconName = this.props.icon;
|
var iconName = this.props.icon;
|
||||||
var label = this.props.title = this.props.label;
|
var label = this.props.title = this.props.label;
|
||||||
delete this.props.icon, this.props.label;
|
delete this.props.icon, this.props.label;
|
||||||
this.props.config = function(element) {
|
this.props.config = function(element, isInitialized) {
|
||||||
|
if (isInitialized) return;
|
||||||
$(element).tooltip();
|
$(element).tooltip();
|
||||||
};
|
};
|
||||||
this.props.className = 'badge '+(this.props.className || '');
|
this.props.className = 'badge '+(this.props.className || '');
|
||||||
|
this.props.key = this.props.className;
|
||||||
|
|
||||||
return m('span', this.props, [
|
return m('span', this.props, [
|
||||||
icon(iconName+' icon-glyph'),
|
icon(iconName+' icon-glyph'),
|
||||||
|
Reference in New Issue
Block a user