- var changed = false;
- _.pairs(this.definition.params).forEach(function(pair) {
- var paramName = pair[0],
- paramDesc = pair[1];
- if(paramDesc.type === 'key' && paramDesc.key === keyName) {
- this.params[paramName] = toggled;
- changed = true;
- }
- }.bind(this));
-
- if(changed) {
- this._cache = null;
- this.trigger('paramsChanged');
- }
+ this.updateParam(function(paramDesc) {
+ return paramDesc.type === 'key' && paramDesc.key === keyName;
+ }, toggled);