Sha256: dff826ff06f652413e513af9fe1cd88ebd5d10077f1d5df094fb5d64ff810692

Contents?: true

Size: 1007 Bytes

Versions: 5

Compression:

Stored size: 1007 Bytes

Contents

(function() {
  scrivito.editors.stringlist_editor = {
    can_edit: function(element) {
      return $(element).is('[data-scrivito-field-type=stringlist]');
    },
    activate: function(element) {
      var field;
      field = $(element);
      return field.tagEditor({
        initialTags: field.scrivito('content'),
        autocomplete: {
          source: (function(_this) {
            return function(request, response) {
              var fieldName;
              fieldName = $(element).data("scrivitoFieldName");
              return scrivito.suggest_completion(fieldName, request.term).then(function(suggestions) {
                return response(suggestions);
              });
            };
          })(this)
        },
        onChange: function(field, editor, tags) {
          return field.scrivito('save', tags);
        }
      });
    }
  };

  scrivito.on('load', function() {
    return scrivito.define_editor('stringlist', scrivito.editors.stringlist_editor);
  });

}).call(this);

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scrivito_editors-1.1.1 app/assets/javascripts/scrivito_editors/stringlist_editor.js
scrivito_editors-1.1.0 app/assets/javascripts/scrivito_editors/stringlist_editor.js
scrivito_editors-1.1.0.rc3 app/assets/javascripts/scrivito_editors/stringlist_editor.js
scrivito_editors-1.1.0.rc2 app/assets/javascripts/scrivito_editors/stringlist_editor.js
scrivito_editors-1.1.0.rc1 app/assets/javascripts/scrivito_editors/stringlist_editor.js