From c8607c8b818b4554c01294f5c05bc5d20f226f82 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 11 Apr 2014 14:27:53 +0200 Subject: [PATCH] [FIX]few cosmetic of code bzr revid: csn@openerp.com-20140411122753-qzxb29uwkw89mrxs --- addons/web/static/src/css/base.sass | 18 ++++++------- addons/web/static/src/js/chrome.js | 26 +++++++++---------- addons/web/static/src/js/view_form.js | 4 +-- addons/web/static/src/js/views.js | 4 +-- .../static/src/js/view_editor.js | 4 +-- 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f70fee5583f..882d0489c04 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2707,18 +2707,16 @@ body.oe_single_form // Customized modal according bootstrap3 .modal - .modal-header - button.close - border: none - background: none - padding: 1px - height: 18px - font-size: 20px + .modal-header button.close + border: none + background: none + padding: 1px + height: 18px + font-size: 20px .modal-footer text-align: left - .oe_act_window - &.modal-body - padding: 0 + .oe_act_window.modal-body + padding: 0 input[type="radio"], input[type="checkbox"] margin-right: 4px diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f49d9e4d5b1..ee88839e656 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -71,7 +71,7 @@ instance.web.Dialog = instance.web.Widget.extend({ @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 @@ -87,7 +87,7 @@ instance.web.Dialog = instance.web.Widget.extend({ 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) { @@ -151,21 +151,21 @@ instance.web.Dialog = instance.web.Widget.extend({ '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'); @@ -244,7 +244,7 @@ instance.web.CrashManager = instance.web.Class.extend({ 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'); }} @@ -310,7 +310,7 @@ instance.web.RedirectWarningHandler = instance.web.Dialog.extend(instance.web.Ex 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'); }}, @@ -467,7 +467,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ */ 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'); }} @@ -700,7 +700,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({ }, 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'); }} @@ -1021,7 +1021,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ 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(); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3dfe4f6f324..87a7114473e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -587,7 +587,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } if (!_.isEmpty(result.warning)) { new instance.web.Dialog(this, { - modal_size: 'medium', + size: 'medium', title:result.warning.title, buttons: [ {text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }} @@ -3230,7 +3230,7 @@ instance.web.form.M2ODialog = instance.web.Dialog.extend({ init: function(parent) { this._super(parent, { title: _.str.sprintf(_t("Add %s"), parent.string), - modal_size: 'medium', + size: 'medium', }); }, start: function() { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 362740e9ebb..dc9f706d40e 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -943,7 +943,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ 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 @@ -1223,7 +1223,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ domain = $.Deferred().resolve(undefined); } if (ids.length === 0) { - new instance.web.Dialog(this, { title: _t("Warning"), modal_size: 'medium',}, $("
").text(_t("You must choose at least one record."))).open(); + new instance.web.Dialog(this, { title: _t("Warning"), size: 'medium',}, $("
").text(_t("You must choose at least one record."))).open(); return false; } var active_ids_context = { diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index 6fb82bd41c1..ad5e991ae66 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -827,7 +827,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var self = this; this.edit_node_dialog = new instance.web.Dialog(this,{ title: _t("Properties"), - modal_size: 'medium', + size: 'medium', buttons: [ {text: _t("Update"), click: function () { var warn = false, update_values = []; @@ -953,7 +953,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ this.add_widget = []; this.add_node_dialog = new instance.web.Dialog(this,{ title: _t("Properties"), - modal_size: 'medium', + size: 'medium', buttons: [ {text: _t("Update"), click: function() { var check_add_node = true, values = {};