summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2014-04-10 17:50:22 +0200
committerCedric Snauwaert <csn@openerp.com>2014-04-10 17:50:22 +0200
commit3a4e2649780744f8a80807df4bef5539c5c70a7e (patch)
treea5a5e17162da903cc3e17b4ce7d0df6df6fb36d7
parent3ba23748bcbc5f75e66d085315e974ed19c6d622 (diff)
[FIX]use bootstrap modal windows. refactor and cleaned from trunk-ui-to-boostrap-modal
bzr revid: csn@openerp.com-20140410155022-3cqys3zc55idc4vg
-rw-r--r--addons/account/static/src/js/account_move_reconciliation.js6
-rw-r--r--addons/board/static/src/js/dashboard.js9
-rw-r--r--addons/mail/static/src/css/mail.css4
-rw-r--r--addons/mail/static/src/js/mail_followers.js15
-rw-r--r--addons/web_linkedin/static/src/js/linkedin.js14
5 files changed, 20 insertions, 28 deletions
diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js
index cbc0abc4f4d..c9489ee4b90 100644
--- a/addons/account/static/src/js/account_move_reconciliation.js
+++ b/addons/account/static/src/js/account_move_reconciliation.js
@@ -86,10 +86,10 @@ openerp.account = function (instance) {
var self = this;
var ids = this.get_selected_ids();
if (ids.length === 0) {
- instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), {
+ new instance.web.Dialog(this, {
title: _t("Warning"),
- modal: true
- });
+ modal_size: 'medium',
+ }, $("<div />").text(_t("You must choose at least one record."))).open();
return false;
}
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index 65737ad234e..cf756e121da 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -88,15 +88,12 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
var qdict = {
current_layout : this.$el.find('.oe_dashboard').attr('data-layout')
};
- var $dialog = instance.web.dialog($('<div>'), {
- modal: true,
+ var $dialog = instance.web.Dialog(this, {
title: _t("Edit Layout"),
- width: 'auto',
- height: 'auto'
- }).html(QWeb.render('DashBoard.layouts', qdict));
+ }, QWeb.render('DashBoard.layouts', qdict)).open();
$dialog.find('li').click(function() {
var layout = $(this).attr('data-layout');
- $dialog.dialog('destroy');
+ $dialog.modal('hide');
self.do_change_layout(layout);
});
},
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index aef0131346a..0abd8ab1b4e 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -664,13 +664,9 @@
.openerp .oe_followers .oe_partner .oe_hidden{
display: none;
}
-.openerp.ui-dialog .ui-dialog-titlebar .ui-dialog-title{
- padding-right: 20px;
-}
.openerp .oe_followers .oe_show_more{
cursor: pointer;
}
-
/* ---------------- MESSAGES BODY ------------------ */
.openerp .oe_mail .oe_msg_content .oe_blockquote,
.openerp .oe_mail .oe_msg_content blockquote {
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index 04f01efb8af..4933ce542a7 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -94,19 +94,18 @@ openerp_mail_followers = function(session, mail) {
var $currentTarget = $(event.currentTarget);
var user_pid = $currentTarget.data('id');
$('div.oe_edit_actions').remove();
- self.$dialog = new session.web.dialog($('<div class="oe_edit_actions">'), {
- modal: true,
- width: 'auto',
- height: 'auto',
+ self.$dialog = new session.web.Dialog(this, {
+ destroy_on_close: false,
+ modal_size: 'small',
title: _t('Edit Subscription of ') + $currentTarget.siblings('a').text(),
buttons: [
{ text: _t("Apply"), click: function() {
self.do_update_subscription(event, user_pid);
- $(this).dialog("close");
+ this.parents('.modal').modal('hide');
}},
- { text: _t("Cancel"), click: function() { $(this).dialog("close"); }}
+ { text: _t("Cancel"), click: function() { this.parents('.modal').modal('hide'); }}
],
- });
+ }, "<div class='oe_edit_actions'>").open();
return self.fetch_subtypes(user_pid);
},
@@ -272,7 +271,7 @@ openerp_mail_followers = function(session, mail) {
display_subtypes:function (data, id, dialog) {
var self = this;
if (dialog) {
- var $list = self.$dialog;
+ var $list = self.$dialog.$el;
}
else {
var $list = this.$('.oe_subtype_list ul');
diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js
index 5d8d7a29b1d..0d4ab7157fa 100644
--- a/addons/web_linkedin/static/src/js/linkedin.js
+++ b/addons/web_linkedin/static/src/js/linkedin.js
@@ -56,12 +56,12 @@ openerp.web_linkedin = function(instance) {
this.linkedin_def.reject();
this.auth_def.reject();
IN = false;
- instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning", {'error': error})), {
+ var dialog = new instance.web.Dialog(this, {
title: _t("LinkedIn is not enabled"),
buttons: [
- {text: _t("Ok"), click: function() { $(this).dialog("close"); }}
- ]
- });
+ {text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }}
+ ],
+ }, QWeb.render('LinkedIn.DisabledWarning', {error: error})).open();
},
test_linkedin: function() {
var self = this;
@@ -369,11 +369,11 @@ openerp.web_linkedin = function(instance) {
},
bind_event: function() {
var self = this;
- this.$el.parent().on("click", ".oe_linkedin_logout", function () {
+ this.$el.parents('.modal').on("click", ".oe_linkedin_logout", function () {
IN.User.logout();
self.destroy();
});
- this.$search = this.$el.parent().find(".oe_linkedin_advanced_search" );
+ this.$search = this.$el.parents('.modal').find(".oe_linkedin_advanced_search" );
this.$url = this.$search.find("input[name='search']" );
this.$button = this.$search.find("button");
@@ -396,7 +396,7 @@ openerp.web_linkedin = function(instance) {
IN.API.Profile("me")
.fields(["firstName", "lastName"])
.result(function (result) {
- $(QWeb.render('LinkedIn.loginInformation', result.values[0])).appendTo(self.$el.parent().find(".ui-dialog-buttonpane"));
+ $(QWeb.render('LinkedIn.loginInformation', result.values[0])).appendTo(self.$el.parents('.modal').find(".oe_dialog_custom_buttons"));
})
},
do_search: function(url) {