riktar / jkanban

Vanilla Javascript plugin for manage kanban boards
https://www.riccardotartaglia.it/jkanban/
Apache License 2.0
1.07k stars 299 forks source link

How to make a Board not movable ? #32

Closed poetawd closed 5 years ago

poetawd commented 5 years ago

Is there a way to make a board not movable ? Dragable ?

In my case, I am building a Kanban board that has a Backlog and a Finished Boards.... I want to make those statics... not movables....

Is there a way to do this ?

Thank you

poetawd commented 5 years ago

This is how I made it.... It is a HACK... but works....

  //Init Drag Board
                self.drakeBoard = self.dragula([self.container], {
                    moves: function (el, source, handle, sibling) {
                        if (!self.options.dragBoards) return false;

                        if ( handle.classList.contains('kanban-fixed') )  return false;

                        return (handle.classList.contains('kanban-board-header') || handle.classList.contains('kanban-title-board'));
                    },

And Added the class kanban-fixed to NOT MOVABLE boards....

It would be VERY NICE to have a option in board object to be not movable....

Thank you

poetawd commented 5 years ago

The only problem that I cant fix is that other boards still can take place of Backlog and Finished boards... :(

marcosrocha85 commented 5 years ago

In my case I decided to make all boards fixed so I haven't had that problem. In any case, I guess you can cancel dragging at "drop" event of jKanban by comparing target and source and then cancel dragula like:

jkanban = new jKanban({
    element: "#mykanban",
    dropBoard: function(el, target, source, sibling) {
        if (target.dataset.id === "_backlog") {
            jkanban.drake.cancel(true);
        }
    }
});
poetawd commented 5 years ago

Awwesssooommmeee !!!

Thank you for the reply !

But still, would be a great addition to have a option to make certain board static...

Em qui, 25 de out de 2018 às 10:22, Marcos Rocha notifications@github.com escreveu:

In my case I decided to make all boards fixed so I haven't had that problem. In any case, I guess you can cancel dragging at "drop" event of jKanban by comparing target and source and then cancel dragula like:

jkanban = new jKanban({ element: "#mykanban", dropBoard: function(el, target, source, sibling) { if (target.dataset.id === "_backlog") { jkanban.drake.cancel(true); } } });

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/riktar/jkanban/issues/32#issuecomment-433048615, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOlGrXBDRCw07TlU1-UTeMXCLNhJnsJks5uobsrgaJpZM4X4iD_ .

--

www.emog.com.br

P Antes de Imprimir pense em seu compromisso com o Meio Ambiente

Esta mensagem, incluindo seus anexos, pode conter informações privilegiadas e/ou de caráter confidencial, não podendo ser retransmitida sem autorização do remetente. Se você não é o destinatário ou pessoa autorizada a recebê-la, informamos que o seu uso, divulgação, cópia ou arquivamento são proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e delete o seu conteúdo.

darkvovich commented 5 months ago

For boards correct is jkanban.drakeBoard.cancel(true);