mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Add a widget setting for the home logo url
This commit is contained in:
parent
43bbc425e8
commit
02f771e66e
1 changed files with 7 additions and 10 deletions
|
@ -1,11 +1,15 @@
|
|||
import DiscourseURL from 'discourse/lib/url';
|
||||
import { createWidget } from 'discourse/widgets/widget';
|
||||
import { h } from 'virtual-dom';
|
||||
import { iconNode } from 'discourse/helpers/fa-icon';
|
||||
import interceptClick from 'discourse/lib/intercept-click';
|
||||
|
||||
export default createWidget('home-logo', {
|
||||
tagName: 'div.title',
|
||||
|
||||
settings: {
|
||||
href: '/'
|
||||
},
|
||||
|
||||
logo() {
|
||||
const { siteSettings } = this;
|
||||
const mobileView = this.site.mobileView;
|
||||
|
@ -33,15 +37,8 @@ export default createWidget('home-logo', {
|
|||
},
|
||||
|
||||
html() {
|
||||
return h('a', { attributes: { href: "/", 'data-auto-route': true } }, this.logo());
|
||||
return h('a', { attributes: { href: this.settings.href } }, this.logo());
|
||||
},
|
||||
|
||||
click(e) {
|
||||
if (e.shiftKey || e.metaKey || e.ctrlKey || e.button !== 0) { return true; }
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
DiscourseURL.routeTo("/");
|
||||
return false;
|
||||
}
|
||||
click: interceptClick
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue