From fd957bf9f733257a5b3f3abeffc772a1a9cf54ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 24 Mar 2014 15:51:29 +0100 Subject: [PATCH] editor: dialog - allow for hiding submit/cancel buttons For a button to show up, its label must be set explicitly. --- src/editor/modules/data/data.js | 6 ++++-- src/editor/views/dialog/dialog.html | 8 ++++++-- src/editor/views/dialog/dialog.js | 5 ++--- 3 files changed, 12 insertions(+), 7 deletions(-) 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'); -- 2.20.1