For a button to show up, its label must be set explicitly.
dialog = Dialog.create({
fields: documentSaveForm.fields,
title: gettext('Save Document'),
- executeButtonText: gettext('Save')
+ executeButtonText: gettext('Save'),
+ cancelButtonText: gettext('Cancel')
});
dialog.on('execute', function(event) {
dialog = Dialog.create({
fields: documentRestoreForm.fields,
title: gettext('Restore Version'),
- executeButtonText: gettext('Restore')
+ executeButtonText: gettext('Restore'),
+ cancelButtonText: gettext('Cancel')
});
dialog.on('execute', function(event) {
<div class="modal-body">
</div>
<div class="modal-footer">
- <a href="#" class="btn btn-info btn-mini execute-btn"><%= executeButtonText %></a>
- <a href="#" class="btn btn-danger btn-mini cancel-btn"><%= cancelButtonText %></a>
+ <% if(executeButtonText) { %>
+ <a href="#" class="btn btn-info btn-mini execute-btn"><%= executeButtonText %></a>
+ <% } %>
+ <% if(cancelButtonText) { %>
+ <a href="#" class="btn btn-danger btn-mini cancel-btn"><%= cancelButtonText %></a>
+ <% } %>
</div>
</div>
\ No newline at end of file
define(function(require) {
- /* globals gettext */
'use strict';
var _ = require('libs/underscore'),
},
show: function() {
this.setElement(this.template(_.extend({
- executeButtonText: gettext('Submit'),
- cancelButtonText: gettext('Cancel')
+ executeButtonText: null,
+ cancelButtonText: null
}, this.options)));
var body = this.$('.modal-body');