<commit_before>
/*********************************************
*
* List, list --> card Helpers, rendered, events
* 
***********************************************/

if (Meteor.isClient) {
    Template.list.helpers({
        all: function() {
            return Lists.find({ board_id: Session.get("board_id")});
        },
        board: function() {
            return Boards.findOne({ _id: Session.get("board_id") });
        },
        cards: function(list_id) {
            return Cards.find({
                board_id: Session.get("board_id"),
                list_id: list_id
            });
        }
    });

    Template.list.rendered = function() {
        jQuery("body").addClass("boardPage");

        // resize board carts scrolling.
        var resize = function() {
            var body_canvas = jQuery(".board-canvas");
            body_canvas.height($(window).height() - 100);

            // resize update canvas list height
            updateListHeight();
        };

        // nitialize and resize body
        $(window).resize(resize); resize();

        // update width area
        updateListAreaWidth(); 

        // update canvas list height
        updateListHeight();
    };

    Template.list.events({
        "click .open-card-composer": function(e) {
            var $this = jQuery(e.currentTarget),
                list = $this.parents(".list"),
                addForm = list.find(".CardAddForm");

            // click hide
            $this.hide(); addForm.fadeIn(100);

            // focus textarea
            list.find("textarea").focus();

            e.preventDefault();
        },
        "submit #ListAddForm": function(e) {
            var $this = jQuery(e.currentTarget);

            elemVal($this.find(".list-name-input"), function(elem, val, slug) {
                var insert_data = {
                    name: val,
                    slug: slug,
                    board_id: Session.get("board_id")
                };
<commit_msg>click card add hide not<commit_after>
/*********************************************
*
* List, list --> card Helpers, rendered, events
* 
***********************************************/

if (Meteor.isClient) {
    Template.list.helpers({
        all: function() {
            return Lists.find({ board_id: Session.get("board_id")});
        },
        board: function() {
            return Boards.findOne({ _id: Session.get("board_id") });
        },
        cards: function(list_id) {
            return Cards.find({
                board_id: Session.get("board_id"),
                list_id: list_id
            });
        }
    });

    Template.list.rendered = function() {
        jQuery("body").addClass("boardPage");

        // resize board carts scrolling.
        var resize = function() {
            var body_canvas = jQuery(".board-canvas");
            body_canvas.height($(window).height() - 100);

            // resize update canvas list height
            updateListHeight();
        };

        // nitialize and resize body
        $(window).resize(resize); resize();

        // update width area
        updateListAreaWidth(); 

        // update canvas list height
        updateListHeight();
    };

    Template.list.events({
        "click .open-card-composer": function(e) {
            var $this = jQuery(e.currentTarget),
                list = $this.parents(".list"),
                addForm = list.find(".CardAddForm");

            // click hide
            $this.hide(); addForm.fadeIn(100);

            // focus textarea
            list.find("textarea").focus();

            e.preventDefault();
        },

        "focus .card-title": function(e) {
            var $this = jQuery(e.currentTarget),
                form = $this.parents(".CardAddForm"),
                not_forms = jQuery(".CardAddForm").not(form),
                list = not_forms.parents(".list");

            // not $this hide CardAddForm
            not_forms.hide();
            
            // all cart add show
            list.find(".js-open-card-composer").show();
        },

        "submit #ListAddForm": function(e) {
            var $this = jQuery(e.currentTarget);

            elemVal($this.find(".list-name-input"), function(elem, val, slug) {
                var insert_data = {
                    name: val,
                    slug: slug,
                    board_id: Session.get("board_id")
                };

{'fraction_non_alphanumeric': 0.17394254693508257, 'fraction_numerical': 0.0027143180275955667, 'mean_word_length': 1.6494907130017975, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6497877', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1117, 'n_words': 232}