Preventing dragging of icon/avatars
parent
120c1deab1
commit
0a78890159
|
@ -29,6 +29,7 @@ export const AvatarRenderer = React.memo((props: { avatar: ClientAvatar | "loadi
|
|||
event.preventDefault();
|
||||
image_preview.preview_image(imageUrl, undefined);
|
||||
}}
|
||||
draggable={false}
|
||||
/>;
|
||||
break;
|
||||
|
||||
|
@ -46,15 +47,16 @@ export const AvatarRenderer = React.memo((props: { avatar: ClientAvatar | "loadi
|
|||
event.preventDefault();
|
||||
image_preview.preview_image(imageUrl, undefined);
|
||||
}}
|
||||
draggable={false}
|
||||
/>;
|
||||
break;
|
||||
|
||||
case "errored":
|
||||
image = <img key={"error"} alt={typeof props.alt === "string" ? props.alt : tr("error")} title={tr("avatar failed to load:\n") + props.avatar.getLoadError()} src={imageUrl} style={ImageStyle} />;
|
||||
image = <img draggable={false} key={"error"} alt={typeof props.alt === "string" ? props.alt : tr("error")} title={tr("avatar failed to load:\n") + props.avatar.getLoadError()} src={imageUrl} style={ImageStyle} />;
|
||||
break;
|
||||
|
||||
case "loading":
|
||||
image = <img key={"loading"} alt={typeof props.alt === "string" ? props.alt : tr("loading")} title={tr("loading avatar")} src={kLoadingAvatarImage} style={ImageStyle} />;
|
||||
image = <img draggable={false} key={"loading"} alt={typeof props.alt === "string" ? props.alt : tr("loading")} title={tr("loading avatar")} src={kLoadingAvatarImage} style={ImageStyle} />;
|
||||
break;
|
||||
|
||||
case undefined:
|
||||
|
|
|
@ -46,7 +46,7 @@ export class LocalIconRenderer extends React.Component<LoadedIconRenderer, {}> {
|
|||
return <div key={"loaded-empty"} className={"icon-container icon-empty"} title={this.props.title} />;
|
||||
return <div key={"loaded"} className={"icon_em client-group_" + icon.icon_id} />;
|
||||
}
|
||||
return <div key={"icon"} className={"icon-container " + this.props.className}><img style={{ maxWidth: "100%", maxHeight: "100%" }} src={icon.loaded_url} alt={this.props.title || ("icon " + icon.icon_id)} /></div>;
|
||||
return <div key={"icon"} className={"icon-container " + this.props.className}><img style={{ maxWidth: "100%", maxHeight: "100%" }} src={icon.loaded_url} alt={this.props.title || ("icon " + icon.icon_id)} draggable={false} /></div>;
|
||||
} else if(icon.status === "loading")
|
||||
return <div key={"loading"} className={"icon-container " + this.props.className} title={this.props.title}><div className={"icon_loading"} /></div>;
|
||||
else if(icon.status === "error")
|
||||
|
|
Loading…
Reference in New Issue