From: Aleksander Ɓukasz Date: Mon, 24 Mar 2014 14:51:29 +0000 (+0100) Subject: editor: dialog - allow for hiding submit/cancel buttons X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/fd957bf9f733257a5b3f3abeffc772a1a9cf54ed editor: dialog - allow for hiding submit/cancel buttons For a button to show up, its label must be set explicitly. --- diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index 3bb2c2c..540f896 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -175,7 +175,8 @@ return function(sandbox) { dialog = Dialog.create({ fields: documentSaveForm.fields, title: gettext('Save Document'), - executeButtonText: gettext('Save') + executeButtonText: gettext('Save'), + cancelButtonText: gettext('Cancel') }); dialog.on('execute', function(event) { @@ -239,7 +240,8 @@ return function(sandbox) { dialog = Dialog.create({ fields: documentRestoreForm.fields, title: gettext('Restore Version'), - executeButtonText: gettext('Restore') + executeButtonText: gettext('Restore'), + cancelButtonText: gettext('Cancel') }); dialog.on('execute', function(event) { diff --git a/src/editor/views/dialog/dialog.html b/src/editor/views/dialog/dialog.html index 80c9fb2..1576831 100644 --- a/src/editor/views/dialog/dialog.html +++ b/src/editor/views/dialog/dialog.html @@ -6,7 +6,11 @@ \ No newline at end of file diff --git a/src/editor/views/dialog/dialog.js b/src/editor/views/dialog/dialog.js index 04d8f74..bad349d 100644 --- a/src/editor/views/dialog/dialog.js +++ b/src/editor/views/dialog/dialog.js @@ -1,6 +1,5 @@ define(function(require) { - /* globals gettext */ 'use strict'; var _ = require('libs/underscore'), @@ -27,8 +26,8 @@ define(function(require) { }, show: function() { this.setElement(this.template(_.extend({ - executeButtonText: gettext('Submit'), - cancelButtonText: gettext('Cancel') + executeButtonText: null, + cancelButtonText: null }, this.options))); var body = this.$('.modal-body');