At.js icon indicating copy to clipboard operation
At.js copied to clipboard

Is cleaning after new selecting

Open edelciomolina opened this issue 7 years ago • 0 comments

Is there a way to click to select a new key without clearing the text inserted previously?

atjs

I expeted that the text inside the element changes only after a new is selected. I´m using with FROALA as shown below:

        var names = [
            { group: 'Geral', name: 'Data Atual', key: 'Geral.DataAtual' },
            { group: 'Geral', name: 'Dia da Semana', key: 'Geral.DiaSemana' },
            { group: 'Geral', name: 'Dia da Semana Extenso', key: 'Geral.DiaSemanaExtenso' },
            { group: 'Pessoa', name: 'Nome', key: 'Pessoa.Nome' },
            { group: 'Pessoa', name: 'Data Nascimento', key: 'Pessoa.DataNascimento' },
            { group: 'Pessoa', name: 'Data do Contrato', key: 'Pessoa.DataContrato' },
        ]

        var keywords_config = {
            at: "{",
            data: names,
            headerTpl: '<div class="atwho-header">Digite para pesquisar</div>',
            displayTpl: "<li>${group} <small>${name} </small></li>",
            insertTpl: '{${key}}',
            limit: 200
        }

        editor.$el.atwho(keywords_config)
            .on('inserted.atwho', function (event, $li, browser_event) {
                editor.$el.find('.atwho-inserted').removeAttr('contenteditable'); 
            });

edelciomolina avatar Apr 19 '18 01:04 edelciomolina