def on_mouse_click(self, event):
        """If an item was clicked, trigger mode to drag it.

        Parameters
        ==========
        event (pygame.event.Event of pygame.MOUSEBUTTONDOWN
               type)
            We use it to retrieve the mouse position when
            the mouse left button is pressed; it is also
            required in order to comply w/ the protocol used;

            Check pygame.event module documentation on
            pygame website for more info about this event
            object.
        """
        ### retrieve the mouse postion
        mouse_pos = event.pos

        ### iterate over items

        for item in chain(
            self.items,
            self.available_items,
        ):

            ## if there's a collision, break out of
            ## the current "for loop"

            if item.rect.collidepoint(mouse_pos):
                break

        ### if we didn't break out of the "for loop", it
        ### means we didn't collide with any items, so
        ### we can exit the method by returning
        else:
            return

        ### otherwise, we have hit an item, so we enable
        ### the drag mode passing the references to both
        ### the list and the item which collided with the
        ### mouse

        collection = self.items if item in self.items else self.available_items

        self.enable_drag_mode(collection, item)
If an item was clicked, trigger mode to drag it.

        Parameters
        ==========
        event (pygame.event.Event of pygame.MOUSEBUTTONDOWN
               type)
            We use it to retrieve the mouse position when
            the mouse left button is pressed; it is also
            required in order to comply w/ the protocol used;

            Check pygame.event module documentation on
            pygame website for more info about this event
            object.
        
nodezator/our3rdlibs/sortingeditor/modes.py