[IMP] Dialog: renamed @options to @dialog_options in order to allow mixin without property collision

bzr revid: fme@openerp.com-20110808171407-mfclmemaljegwsgg
This commit is contained in:
Fabien Meghazi 2011-08-08 19:14:07 +02:00
parent 1a9e157eb5
commit 16c38f64c7
1 changed files with 10 additions and 10 deletions

View File

@ -305,10 +305,10 @@ openerp.base.Notification = openerp.base.Widget.extend({
openerp.base.Dialog = openerp.base.OldWidget.extend({ openerp.base.Dialog = openerp.base.OldWidget.extend({
dialog_title: "", dialog_title: "",
identifier_prefix: 'dialog', identifier_prefix: 'dialog',
init: function (parent, options) { init: function (parent, dialog_options) {
var self = this; var self = this;
this._super(parent); this._super(parent);
this.options = { this.dialog_options = {
modal: true, modal: true,
width: 'auto', width: 'auto',
min_width: 0, min_width: 0,
@ -324,11 +324,11 @@ openerp.base.Dialog = openerp.base.OldWidget.extend({
}; };
for (var f in this) { for (var f in this) {
if (f.substr(0, 10) == 'on_button_') { if (f.substr(0, 10) == 'on_button_') {
this.options.buttons[f.substr(10)] = this[f]; this.dialog_options.buttons[f.substr(10)] = this[f];
} }
} }
if (options) { if (dialog_options) {
this.set_options(options); this.set_options(dialog_options);
} }
}, },
set_options: function(options) { set_options: function(options) {
@ -351,7 +351,7 @@ openerp.base.Dialog = openerp.base.OldWidget.extend({
if (!options.title && this.dialog_title) { if (!options.title && this.dialog_title) {
options.title = this.dialog_title; options.title = this.dialog_title;
} }
_.extend(this.options, options); _.extend(this.dialog_options, options);
}, },
get_width: function(val) { get_width: function(val) {
return this.get_size(val.toString(), $(window.top).width()); return this.get_size(val.toString(), $(window.top).width());
@ -369,19 +369,19 @@ openerp.base.Dialog = openerp.base.OldWidget.extend({
} }
}, },
start: function (auto_open) { start: function (auto_open) {
this.$dialog = $('<div id="' + this.element_id + '"></div>').dialog(this.options); this.$dialog = $('<div id="' + this.element_id + '"></div>').dialog(this.dialog_options);
if (auto_open !== false) { if (auto_open !== false) {
this.open(); this.open();
} }
this._super(); this._super();
}, },
open: function(options) { open: function(dialog_options) {
// TODO fme: bind window on resize // TODO fme: bind window on resize
if (this.template) { if (this.template) {
this.$element.html(this.render()); this.$element.html(this.render());
} }
this.set_options(options); this.set_options(dialog_options);
this.$dialog.dialog(this.options).dialog('open'); this.$dialog.dialog(this.dialog_options).dialog('open');
}, },
close: function() { close: function() {
// Closes the dialog but leave it in a state where it could be opened again. // Closes the dialog but leave it in a state where it could be opened again.