AppSuite:Files App Actions

From Open-Xchange
Revision as of 14:26, 12 April 2013 by Tierlieb (talk | contribs) (Created page with "<div class="title">Adding actions to the files detail area</div> To add an action to the files app detail area the extensionpoint io.ox/files/links/inline is used. Use the Li...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Adding actions to the files detail area

To add an action to the files app detail area the extensionpoint io.ox/files/links/inline is used. Use the Link pattern in io.ox/core/extPatterns/links.js to extend this point. Try via console:

 
require(['io.ox/core/extensions', 'io.ox/core/extPatterns/links'], function (ext, links) {

  new links.Action('io.ox/files/actions/testlink', {
    requires: function (e) {
      e.collection.has('some') && capabilities.has('webmail');
    },
    multiple: function (baton) {
      console.log(baton);
    }
  });

  ext.point('io.ox/files/links/inline').extend(new links.Link({
    id: 'testlink',
    index: 400,
    label: 'labelname',
    ref: 'io.ox/files/actions/testlink'
  }));
});

Action

The first argument is the unique id of the action.

requires - checks for the needed components and the collection status. (some is used for multiple elements, one for an single one)

  • If the action is used only on a single element use action.
  • If the action should be applied to multiple elements use multiple.
  • In both cases the baton is available to the action.

Link

  • id - must be unique
  • index - the position/order of the link
  • label - the label for the link
  • ref - the reference to the action id