<commit_before>/*
 * Copyright 2015. Author: <NAME>. All Rights Reserved.
 *
 * MIT License
 *
 * drawerClass directive
 */
'use strict';

//--------------------------------------
// Module exports
//--------------------------------------

module.exports = drawerClassDirective;

//--------------------------------------
// Directive
//--------------------------------------

/*
 * The drawerClassDirective dynamically updates the element's classes
 * whenever the state of the drawer changes.
 *
 * @example
 *    <div drawer-class='{open: "my-open" , closed: "my-closed"}'></div>
 *
 * @param {string} directiveNames.cabinet
 * @param {string} directiveNames.drawerClass
 * @return {object} directive
 */
function drawerClassDirective(directiveNames, parse) {

    return {
        link: {
            pre: prelink
        },
        require: '^' + directiveNames.cabinet
    };

    function prelink(scope, element, attrs, cabinetCtrl) {
        var classes = parse(attrs[directiveNames.drawerClass])(scope);

        var drawerCtrl = cabinetCtrl.getDrawerController(classes.id);

        // Listen for open changes.<commit_msg>Fix documentation issue.<commit_after>/*
 * Copyright 2015. Author: <NAME>. All Rights Reserved.
 *
 * MIT License
 *
 * drawerClass directive
 */
'use strict';

//--------------------------------------
// Module exports
//--------------------------------------

module.exports = drawerClassDirective;

//--------------------------------------
// Directive
//--------------------------------------

/*
 * The drawerClassDirective dynamically updates the element's classes
 * whenever the state of the drawer changes.
 *
 * @example
 *    <div drawer-class='{open: "my-open" , closed: "my-closed"}'></div>
 *
 * @param {string} directiveNames.cabinet
 * @param {string} directiveNames.drawerClass
 * @param {object} parse The angular parse service.
 * @return {object} directive
 */
function drawerClassDirective(directiveNames, parse) {

    return {
        link: {
            pre: prelink
        },
        require: '^' + directiveNames.cabinet
    };

    function prelink(scope, element, attrs, cabinetCtrl) {
        var classes = parse(attrs[directiveNames.drawerClass])(scope);

        var drawerCtrl = cabinetCtrl.getDrawerController(classes.id);

        // Listen for open changes.
{'fraction_non_alphanumeric': 0.24086021505376345, 'fraction_numerical': 0.0034408602150537634, 'mean_word_length': 1.9147869674185463, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6816136', 'n_tokens_mistral': 617, 'n_tokens_neox': 588, 'n_words': 152}