Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a Board not movable ? #32

Closed
poetawd opened this issue Oct 24, 2018 · 5 comments
Closed

How to make a Board not movable ? #32

poetawd opened this issue Oct 24, 2018 · 5 comments

Comments

@poetawd
Copy link

poetawd commented Oct 24, 2018

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
Copy link
Author

poetawd commented Oct 24, 2018

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
Copy link
Author

poetawd commented Oct 24, 2018

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

@marcosrocha85
Copy link
Contributor

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
Copy link
Author

poetawd commented Oct 25, 2018 via email

@darkvovich
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants