@param {Widget} parent
@param {dictionary} options A dictionary that will be forwarded to jQueryUI Dialog. Additionaly, that
dictionary can contain the following keys:
- - modal_size: one of the following: 'large', 'medium', 'small'
+ - size: one of the following: 'large', 'medium', 'small'
- dialogClass: class to add to the body of dialog
- buttons: Deprecated. The buttons key is not propagated to jQueryUI Dialog. It must be a dictionary (key = button
label, value = click handler) or a list of dictionaries (each element in the dictionary is send to the
this.content_to_set = content;
this.dialog_options = {
destroy_on_close: true,
- modal_size: 'large', //'medium', 'small'
+ size: 'large', //'medium', 'small'
buttons: null,
};
if (options) {
'backdrop': false,
'keyboard': true,
});
- if (options.modal_size !== 'large'){
+ if (options.size !== 'large'){
var dialog_class_size = this.$dialog_box.find('.modal-lg').removeClass('modal-lg')
- if (options.modal_size === 'small'){
+ if (options.size === 'small'){
dialog_class_size.addClass('modal-sm');
}
}
this.$el.appendTo(this.$dialog_box.find(".modal-body"));
- var dialog_body = this.$dialog_box.find('.modal-content');
+ var $dialog_content = this.$dialog_box.find('.modal-content');
if (options.dialogClass){
- dialog_body.find(".modal-body").addClass(options.dialogClass);
+ $dialog_content.find(".modal-body").addClass(options.dialogClass);
}
- dialog_body.openerpClass();
+ $dialog_content.openerpClass();
- this.$dialog_box.on('hidden.bs.modal',this,function(){
+ this.$dialog_box.on('hidden.bs.modal', this, function(){
self.trigger("closing");
});
this.$dialog_box.modal('show');
error = _.extend({}, error, {data: _.extend({}, error.data, {message: error.data.arguments[0] + "\n\n" + error.data.arguments[1]})});
}
new instance.web.Dialog(this, {
- modal_size: 'medium',
+ size: 'medium',
title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"),
buttons: [
{text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }}
error.data.message = error.data.arguments[0];
new instance.web.Dialog(this, {
- modal_size: 'medium',
+ size: 'medium',
title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"),
buttons: [
{text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }},
*/
display_error: function (error) {
return new instance.web.Dialog(this, {
- modal_size: 'medium',
+ size: 'medium',
title: error.title,
buttons: [
{text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }}
},
display_error: function (error) {
return new instance.web.Dialog(this, {
- modal_size: 'medium',
+ size: 'medium',
title: error.title,
buttons: [
{text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }}
window.location = $.param.querystring( window.location.href, 'debug');
});
new instance.web.Dialog(this, {
- modal_size: 'medium',
+ size: 'medium',
dialogClass: 'oe_act_window',
title: _t("About"),
}, $help).open();
this.dataset.call('perm_read', [ids]).done(function(result) {
var dialog = new instance.web.Dialog(this, {
title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model),
- modal_size: 'medium',
+ size: 'medium',
}, QWeb.render('ViewManagerDebugViewLog', {
perm : result[0],
format : instance.web.format_value
domain = $.Deferred().resolve(undefined);
}
if (ids.length === 0) {
- new instance.web.Dialog(this, { title: _t("Warning"), modal_size: 'medium',}, $("<div />").text(_t("You must choose at least one record."))).open();
+ new instance.web.Dialog(this, { title: _t("Warning"), size: 'medium',}, $("<div />").text(_t("You must choose at least one record."))).open();
return false;
}
var active_ids_context = {