Skip to content

Commit 9e6db4b

Browse files
committed
Add separate "Save" and "Save and close" buttons to the setting window [#135]
1 parent 5dac354 commit 9e6db4b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

assets/components/clientconfig/js/mgr/widgets/window.settings.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,24 @@ ClientConfig.window.Setting = function(config) {
122122
}]
123123
}]
124124
}],
125-
keys: [] //prevent enter in textarea from firing submit
125+
keys: [], //prevent enter in textarea from firing submit
126+
buttons: [{
127+
text: _('cancel'),
128+
scope: this,
129+
handler: function() { this.hide(); }
130+
},'-',{
131+
text: _('save'),
132+
scope: this,
133+
handler: function () {
134+
this.submit(false);
135+
},
136+
cls: 'primary-button'
137+
}, {
138+
text: _('save_and_close'),
139+
scope: this,
140+
handler: this.submit,
141+
cls: 'primary-button'
142+
}]
126143
});
127144
ClientConfig.window.Setting.superclass.constructor.call(this,config);
128145
};

core/components/clientconfig/docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Add a code field type (requires Ace editor) for things like custom CSS or other markup [#144]
77
- Add an email field type which validates the value to be an email address [#65]
88
- Include OnHandleRequest plugin event (alongside OnMODXInit), to make ClientConfig play nicer with various context routing and other solutions that don't use OnMODXInit [#140]
9+
- Add separate "Save" and "Save and close" buttons to the setting window [#135]
910

1011
ClientConfig 2.2.0-pl
1112
---------------------

0 commit comments

Comments
 (0)