Allow empty board list.

This commit is contained in:
Nicolas Stepien 2013-03-12 18:58:50 +01:00
parent 9e03194f7d
commit d41c9d9ee6
2 changed files with 8 additions and 4 deletions

View File

@ -1077,6 +1077,11 @@
},
generateBoardList: function(text) {
var as, list, nodes;
list = $('#custom-board-list', Header.bar);
list.innerHTML = null;
if (!text) {
return;
}
as = $$('#full-board-list a', Header.bar).slice(0, -2);
nodes = text.match(/[\w@]+(-(all|title|full|text:"[^"]+"))?|[^\w@]+/g).map(function(t) {
var a, board, m, _i, _len;
@ -1112,8 +1117,6 @@
}
return $.tn(t);
});
list = $('#custom-board-list', Header.bar);
list.innerHTML = null;
return $.add(list, nodes);
},
toggleBoardList: function() {

View File

@ -59,6 +59,9 @@ Header =
Header.setCatalogLinks Conf['Header catalog links']
generateBoardList: (text) ->
list = $ '#custom-board-list', Header.bar
list.innerHTML = null
return unless text
as = $$('#full-board-list a', Header.bar)[0...-2] # ignore the Settings and Home links
nodes = text.match(/[\w@]+(-(all|title|full|text:"[^"]+"))?|[^\w@]+/g).map (t) ->
if /^[^\w@]/.test t
@ -87,8 +90,6 @@ Header =
$.log t, t.match /-text:"(.+)"$/
return a
$.tn t
list = $ '#custom-board-list', Header.bar
list.innerHTML = null
$.add list, nodes
toggleBoardList: ->