Skip to content

Instantly share code, notes, and snippets.

@elchele
Created August 20, 2014 21:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elchele/9442808dd0d78273c387 to your computer and use it in GitHub Desktop.
Save elchele/9442808dd0d78273c387 to your computer and use it in GitHub Desktop.
Custom controller for suppressing "edit" button functionality on Calls subpanel
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/views/subpanel-list/subpanel-list.js
*
* Extended Subpanel List controller to suppress "Edit" functionality
* on "Calls" subpanel throughout Sugar (Sugar 7.2+)
*
*/
extendsFrom: 'SubpanelListView',
initialize: function(options) {
this._super('initialize', [options]);
if (this.module === 'Calls')
{
_.each(this.meta.rowactions.actions, function(action){
var button_name = action['name'];
if(button_name === 'edit_button')
{
delete action['event'];
action['css_class'] = 'disabled btn';
}
});
}
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment