diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-11-15 10:34:48 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-11-15 10:34:48 +0100 |
| commit | 6810fd765c0a2113e44e2d31aa57e5ef2405b9a2 (patch) | |
| tree | ec470bab100b08d7570024549756857a9211a221 /addons/web/static/src/js | |
| parent | 210bbdb149d91eb01d86d4cbfe94ec2e86f7a71a (diff) | |
[FIX] only hide the database when going back to login, don't stop it entirely
the database widget seems to not restart correctly anymore, after being stopped
lp bug: https://launchpad.net/bugs/889718 fixed
bzr revid: xmo@openerp.com-20111115093448-opym0msx0szvaeyt
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 25b73ee59d5..f5fd32b912e 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -242,10 +242,8 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database this.$option_id = $('#' + option_id); }, start: function() { + this._super(); this.$element.html(QWeb.render("Database", this)); - this.$element.closest(".openerp") - .removeClass("login-mode") - .addClass("database_block"); var self = this; var fetch_db = this.rpc("/web/database/get_list", {}, function(result) { @@ -266,23 +264,30 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database this.$element.find('#db-restore').click(this.do_restore); this.$element.find('#db-change-password').click(this.do_change_password); this.$element.find('#back-to-login').click(function() { - self.stop(); + self.hide(); }); }, stop: function () { + this.hide(); this.$option_id.empty(); this.$element .find('#db-create, #db-drop, #db-backup, #db-restore, #db-change-password, #back-to-login') .unbind('click') .end() - .closest(".openerp") - .addClass("login-mode") - .removeClass("database_block") - .end() .empty(); this._super(); }, + show: function () { + this.$element.closest(".openerp") + .removeClass("login-mode") + .addClass("database_block"); + }, + hide: function () { + this.$element.closest(".openerp") + .addClass("login-mode") + .removeClass("database_block") + }, /** * Converts a .serializeArray() result into a dict. Does not bother folding * multiple identical keys into an array, last key wins. @@ -529,9 +534,10 @@ openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ var self = this; this.database = new openerp.web.Database( this, "oe_database", "oe_db_options"); + this.database.start(); this.$element.find('#oe-db-config').click(function() { - self.database.start(); + self.database.show(); }); this.$element.find("form").submit(this.on_submit); @@ -547,6 +553,10 @@ openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ }); }, + stop: function () { + this.database.stop(); + this._super(); + }, on_login_invalid: function() { this.$element.closest(".openerp").addClass("login-mode"); }, |
