Created
August 20, 2014 21:20
-
-
Save elchele/9442808dd0d78273c387 to your computer and use it in GitHub Desktop.
Custom controller for suppressing "edit" button functionality on Calls subpanel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/* 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