[FIX]use bootstrap modal windows. refactor and cleaned from trunk-ui-to-boostrap-modal

bzr revid: csn@openerp.com-20140410155022-3cqys3zc55idc4vg
This commit is contained in:
Cedric Snauwaert 2014-04-10 17:50:22 +02:00
parent 3ba23748bc
commit 3a4e264978
5 changed files with 20 additions and 28 deletions

View File

@ -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;
}

View File

@ -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);
});
},

View File

@ -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 {

View File

@ -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');

View File

@ -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) {