A small patch which enables scroll view toggling.
If there are many columns, the board adds a horizontal scrollbar. However, This looses the full board visibility. Now there is a menu item on the Board, Action > Toggle view which switches. This can also be toggled by 'c' keypress.
This commit is contained in:
@@ -23,6 +23,10 @@ Kanboard.Board = (function() {
|
||||
Mousetrap.bind("s", function() {
|
||||
stack_toggle();
|
||||
});
|
||||
|
||||
Mousetrap.bind("c", function() {
|
||||
compactview_toggle();
|
||||
});
|
||||
}
|
||||
|
||||
// Collapse/Expand tasks
|
||||
@@ -351,6 +355,35 @@ Kanboard.Board = (function() {
|
||||
filter_apply();
|
||||
}
|
||||
|
||||
// Toggle compact view. It will try to stuff all columns in the window
|
||||
jQuery(document).on('click', ".compactview-toggle", function(e) {
|
||||
e.preventDefault();
|
||||
compactview_toggle();
|
||||
});
|
||||
|
||||
function compactview_toggle() {
|
||||
var compactview = Kanboard.GetStorageItem("compactview");
|
||||
if (compactview == '1') {
|
||||
Kanboard.SetStorageItem("compactview",'0');
|
||||
} else {
|
||||
Kanboard.SetStorageItem("compactview",'1');
|
||||
}
|
||||
compactview_reload ();
|
||||
}
|
||||
|
||||
function compactview_reload()
|
||||
{
|
||||
var compactview = Kanboard.GetStorageItem("compactview");
|
||||
$("#board-container,#board th,#board td").removeClass ();
|
||||
if (compactview == '1') {
|
||||
$('#board-container').addClass ('board-container-compact');
|
||||
$("#board th,#board td").addClass ('board-column-compact');
|
||||
} else {
|
||||
$('#board-container').addClass ('board-container-wide');
|
||||
$("#board th,#board td").addClass ('board-column-wide');
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
if (Kanboard.Exists("board")) {
|
||||
@@ -358,7 +391,13 @@ Kanboard.Board = (function() {
|
||||
filter_load_events();
|
||||
stack_load_events();
|
||||
keyboard_shortcuts();
|
||||
compactview_reload();
|
||||
}
|
||||
});
|
||||
|
||||
// Reload the compactview states (shown/hidden) after an ajax call
|
||||
jQuery(document).ajaxComplete(function() {
|
||||
compactview_reload();
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user