Dialog: Use a 'done' button on edit param page instead of 'back'

'Back' suggests that changes in the form won't be saved.

Change-Id: I0df0887caa6317393a3a891dd292aa4dc54cc32b
This commit is contained in:
Ed Sanders 2015-09-14 12:25:22 +01:00
parent fffb070355
commit 9f96761044
4 changed files with 11 additions and 2 deletions

View file

@ -103,6 +103,7 @@
"templatedata-modal-button-cancel",
"templatedata-modal-button-changelang",
"templatedata-modal-button-delparam",
"templatedata-modal-button-done",
"templatedata-modal-button-importParams",
"templatedata-modal-button-restoreparam",
"templatedata-modal-button-saveparam",

View file

@ -51,6 +51,7 @@
"templatedata-modal-button-cancel": "Cancel",
"templatedata-modal-button-changelang": "Change language",
"templatedata-modal-button-delparam": "Remove parameter information",
"templatedata-modal-button-done": "Done",
"templatedata-modal-button-importParams": "Import parameters",
"templatedata-modal-button-restoreparam": "Restore parameter",
"templatedata-modal-button-saveparam": "Save",

View file

@ -59,6 +59,7 @@
"templatedata-modal-button-cancel": "Label of the cancel button.\n{{Identical|Cancel}}",
"templatedata-modal-button-changelang": "Label for the button to change language in the edit dialog.\n{{Identical|Change language}}",
"templatedata-modal-button-delparam": "Button to remove a parameter.",
"templatedata-modal-button-done": "Label of the done button.",
"templatedata-modal-button-importParams": "Label of the import button",
"templatedata-modal-button-restoreparam": "Label for the button to restore a previously deleted parameter in the edit dialog.",
"templatedata-modal-button-saveparam": "Label for the button to save parameter details in the templatedata edit dialog.\n{{Identical|Save}}",

View file

@ -35,6 +35,12 @@ mw.TemplateData.Dialog.static.actions = [
flags: [ 'primary', 'constructive' ],
modes: 'list'
},
{
action: 'done',
label: mw.msg( 'templatedata-modal-button-done' ),
flags: [ 'primary', 'progressive' ],
modes: 'edit'
},
{
action: 'add',
label: mw.msg( 'templatedata-modal-button-addparam' ),
@ -56,7 +62,7 @@ mw.TemplateData.Dialog.static.actions = [
action: 'back',
label: mw.msg( 'templatedata-modal-button-back' ),
flags: 'safe',
modes: [ 'edit', 'language', 'add' ]
modes: [ 'language', 'add' ]
}
];
@ -904,7 +910,7 @@ mw.TemplateData.Dialog.prototype.switchPanels = function ( panel ) {
* @return {OO.ui.Process} Action process
*/
mw.TemplateData.Dialog.prototype.getActionProcess = function ( action ) {
if ( action === 'back' ) {
if ( action === 'back' || action === 'done' ) {
return new OO.ui.Process( function () {
this.switchPanels( 'listParams' );
}, this );