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

Undefined on line 824

Open borisdelev opened this issue 10 years ago • 1 comments

data = $li.data('item-data'); on that line error appear sometimes, when u just start typing but stay just on "#" with no other text.

"Uncaught TypeError: Cannot read property 'data' of undefined"

Thank you!!!

borisdelev avatar Feb 22 '16 15:02 borisdelev

It was from example, callback function:

$('#editable').atwho({
      at: "#",
      data: tags,
      limit: 200,
      callbacks: {
        afterMatchFailed: function(at, el) {
          // 32 is spacebar
          if (at == '#') {
            tags.push(el.text().trim().slice(1));
            this.model.save(tags);
            this.insert(el.text().trim());
            return false;
          }
        }
      }
    });

...without it its ok.

borisdelev avatar Feb 23 '16 11:02 borisdelev