[IMP] Tour: better modal handling
bzr revid: ddm@openerp.com-20131121113507-qmz5inlge2ixkib8
This commit is contained in:
@@ -5,15 +5,12 @@
|
||||
website.menu = {};
|
||||
website.add_template_file('/website/static/src/xml/website.menu.xml');
|
||||
|
||||
var globalEditor;
|
||||
|
||||
website.EditorBar.include({
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action="edit-structure"]': 'editStructure',
|
||||
}),
|
||||
editStructure: function () {
|
||||
var self = this;
|
||||
globalEditor = self;
|
||||
var context = website.get_context();
|
||||
openerp.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
model: 'website.menu',
|
||||
@@ -24,7 +21,6 @@
|
||||
},
|
||||
}).then(function (menu) {
|
||||
var result = new website.menu.EditMenuDialog(menu).appendTo(document.body);
|
||||
self.trigger('tour:menu_editor_dialog_ready');
|
||||
return result;
|
||||
});
|
||||
},
|
||||
@@ -171,7 +167,6 @@
|
||||
$link_text.focus();
|
||||
});
|
||||
});
|
||||
globalEditor.trigger('tour:new_menu_entry_dialog_ready');
|
||||
return result;
|
||||
},
|
||||
save: function () {
|
||||
@@ -192,7 +187,6 @@
|
||||
}
|
||||
},
|
||||
destroy: function () {
|
||||
globalEditor.trigger('tour:new_menu_entry_dialog_closed');
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
title: "Edit menu",
|
||||
content: "Click here to create a new menu entry and manage options.",
|
||||
onShow: function () {
|
||||
editor.on('tour:menu_editor_dialog_ready', editor, function () {
|
||||
$(document).one('shown.bs.modal', function () {
|
||||
self.movetoStep('add-menu-entry');
|
||||
});
|
||||
},
|
||||
@@ -51,7 +51,7 @@
|
||||
title: "Add menu entry",
|
||||
content: "Click here to create a new menu entry.",
|
||||
onShow: function () {
|
||||
editor.on('tour:new_menu_entry_dialog_ready', editor, function () {
|
||||
$(document).one('shown.bs.modal', function () {
|
||||
self.movetoStep('enter-entry-name');
|
||||
});
|
||||
},
|
||||
@@ -79,7 +79,7 @@
|
||||
title: "Save the page",
|
||||
content: "Save your new page.",
|
||||
onShow: function () {
|
||||
editor.on('tour:new_menu_entry_dialog_closed', editor, function () {
|
||||
$(document).one('hidden.bs.modal', function () {
|
||||
self.movetoStep('save-menu');
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user