'click .crm-designer-preview': 'doPreview'
},
onRender: function() {
- this.$('.crm-designer-save').button();
+ this.$('.crm-designer-save').button().attr({
+ disabled: 'disabled',
+ style: 'opacity:.5; box-shadow:none; cursor:default;'
+ });
this.$('.crm-designer-preview').button();
},
+ initialize: function(options) {
+ CRM.designerApp.vent.on('ufUnsaved', this.onUfChanged, this);
+ },
+ onUfChanged: function(isUfUnsaved) {
+ if (isUfUnsaved) {
+ this.$('.crm-designer-save').removeAttr('style').removeAttr('disabled');
+ }
+ },
doSave: function(event) {
var ufGroupModel = this.model;
if (ufGroupModel.getRel('ufFieldCollection').hasDuplicates()) {