Skip to content

Commit

Permalink
docs: update popup menu provider example
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac authored Oct 21, 2022
1 parent 81dc46d commit 55d0a7b
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions lib/features/popup-menu/PopupMenuProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ PopupMenuProvider.$inject = [ 'popupMenu' ];


/**
* This method should implement the creation or update of a map of entry objects.
*
* @param {djs.model.Base} element
*
* The following example shows how to replace any entries returned
* by previous providers with one entry which alerts the id of the current selected
* element, when clicking on the entry.
*
* @example
* PopupMenuProvider.getPopupMenuEntries = function(element) {
* return function(entries) {
* return {
* alert: {
* label: 'Alert element ID',
* className: 'alert',
* action: function () {
* alert(element.id);
* }
* };
* };
*/
PopupMenuProvider.getPopupMenuEntries = function(element) {};


/**
* @deprecated
* This method should implement the creation of a list of entry objects.
*
* @param {djs.model.Base} element
Expand All @@ -33,7 +59,7 @@ PopupMenuProvider.$inject = [ 'popupMenu' ];
* }];
*
* return entries;
*}
* };
*/
PopupMenuProvider.getEntries = function(element) {};

Expand Down Expand Up @@ -71,4 +97,4 @@ PopupMenuProvider.getHeaderEntries = function(element) {};
* this._popupMenu.registerProvider('my-provider-id', this);
* }
*/
PopupMenuProvider.register = function() {};
PopupMenuProvider.register = function() {};

0 comments on commit 55d0a7b

Please sign in to comment.