Bind an index refresh to the current board's link
I mean, this makes sense, right?
This commit is contained in:
parent
a980c540a9
commit
456c9af18d
@ -1711,6 +1711,7 @@
|
|||||||
_this.footer = $.id('boardNavDesktopFoot');
|
_this.footer = $.id('boardNavDesktopFoot');
|
||||||
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
|
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
|
||||||
a.className = 'current';
|
a.className = 'current';
|
||||||
|
$.on(a, 'click', Index.cb.link);
|
||||||
}
|
}
|
||||||
cs = $.el('a', {
|
cs = $.el('a', {
|
||||||
id: 'settingsWindowLink',
|
id: 'settingsWindowLink',
|
||||||
@ -1745,6 +1746,7 @@
|
|||||||
fourchannav = $.id('boardNavDesktop');
|
fourchannav = $.id('boardNavDesktop');
|
||||||
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
|
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
|
||||||
a.className = 'current';
|
a.className = 'current';
|
||||||
|
$.on(a, 'click', Index.cb.link);
|
||||||
}
|
}
|
||||||
boardList = $.el('span', {
|
boardList = $.el('span', {
|
||||||
id: 'board-list',
|
id: 'board-list',
|
||||||
@ -2259,6 +2261,13 @@
|
|||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return Index.userPageNav(+a.pathname.split('/')[2]);
|
return Index.userPageNav(+a.pathname.split('/')[2]);
|
||||||
|
},
|
||||||
|
link: function(e) {
|
||||||
|
if (g.VIEW !== 'index' || /catalog/.test(this.href)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
|
return Index.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrollToIndex: function() {
|
scrollToIndex: function() {
|
||||||
|
|||||||
@ -1721,6 +1721,7 @@
|
|||||||
_this.footer = $.id('boardNavDesktopFoot');
|
_this.footer = $.id('boardNavDesktopFoot');
|
||||||
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
|
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
|
||||||
a.className = 'current';
|
a.className = 'current';
|
||||||
|
$.on(a, 'click', Index.cb.link);
|
||||||
}
|
}
|
||||||
cs = $.el('a', {
|
cs = $.el('a', {
|
||||||
id: 'settingsWindowLink',
|
id: 'settingsWindowLink',
|
||||||
@ -1755,6 +1756,7 @@
|
|||||||
fourchannav = $.id('boardNavDesktop');
|
fourchannav = $.id('boardNavDesktop');
|
||||||
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
|
if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) {
|
||||||
a.className = 'current';
|
a.className = 'current';
|
||||||
|
$.on(a, 'click', Index.cb.link);
|
||||||
}
|
}
|
||||||
boardList = $.el('span', {
|
boardList = $.el('span', {
|
||||||
id: 'board-list',
|
id: 'board-list',
|
||||||
@ -2269,6 +2271,13 @@
|
|||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return Index.userPageNav(+a.pathname.split('/')[2]);
|
return Index.userPageNav(+a.pathname.split('/')[2]);
|
||||||
|
},
|
||||||
|
link: function(e) {
|
||||||
|
if (g.VIEW !== 'index' || /catalog/.test(this.href)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
|
return Index.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrollToIndex: function() {
|
scrollToIndex: function() {
|
||||||
|
|||||||
@ -104,6 +104,7 @@ Header =
|
|||||||
@footer = $.id 'boardNavDesktopFoot'
|
@footer = $.id 'boardNavDesktopFoot'
|
||||||
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
|
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
|
||||||
a.className = 'current'
|
a.className = 'current'
|
||||||
|
$.on a, 'click', Index.cb.link
|
||||||
|
|
||||||
cs = $.el 'a',
|
cs = $.el 'a',
|
||||||
id: 'settingsWindowLink'
|
id: 'settingsWindowLink'
|
||||||
@ -136,6 +137,7 @@ Header =
|
|||||||
fourchannav = $.id 'boardNavDesktop'
|
fourchannav = $.id 'boardNavDesktop'
|
||||||
if a = $ "a[href*='/#{g.BOARD}/']", fourchannav
|
if a = $ "a[href*='/#{g.BOARD}/']", fourchannav
|
||||||
a.className = 'current'
|
a.className = 'current'
|
||||||
|
$.on a, 'click', Index.cb.link
|
||||||
boardList = $.el 'span',
|
boardList = $.el 'span',
|
||||||
id: 'board-list'
|
id: 'board-list'
|
||||||
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-container brackets-wrap'><a href=javascript:; class='hide-board-list-button'> - </a></span> #{fourchannav.innerHTML}</span>"
|
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-container brackets-wrap'><a href=javascript:; class='hide-board-list-button'> - </a></span> #{fourchannav.innerHTML}</span>"
|
||||||
|
|||||||
@ -127,6 +127,10 @@ Index =
|
|||||||
return if a.textContent is 'Catalog'
|
return if a.textContent is 'Catalog'
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
Index.userPageNav +a.pathname.split('/')[2]
|
Index.userPageNav +a.pathname.split('/')[2]
|
||||||
|
link: (e) ->
|
||||||
|
return if g.VIEW isnt 'index' or /catalog/.test @href
|
||||||
|
e.preventDefault()
|
||||||
|
Index.update()
|
||||||
|
|
||||||
scrollToIndex: ->
|
scrollToIndex: ->
|
||||||
Header.scrollToIfNeeded Index.root
|
Header.scrollToIfNeeded Index.root
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user