Skip to content

Commit

Permalink
Better password save (#329)
Browse files Browse the repository at this point in the history
* properly trigger the password save popup
  • Loading branch information
oetiker authored and odeimaiz committed Nov 14, 2018
1 parent ff0ac55 commit a8c7664
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ matrix:
- language: node_js
node_js:
- "8"

cache:
directories:
- .npm

install:
- npm install -g npm@latest
- npm install --save-dev eslint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
// outside a form, so lets accomodate him
this.addListenerOnce("appear", e => {
let el = this.getContentElement();
let form = this._form = new qx.html.Element("form", null, {
let form = this._formElement = new qx.html.Element("form", null, {
name: "fakeLoginform",
autocomplete: "on"
});
Expand Down Expand Up @@ -58,7 +58,7 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
* when all is said and done we should remove the form so that the password manager
* knows to save the content of the form. so we save it here.
*/
_form: null,
_formElement: null,
/**
* This method gets called upon construction and
* must be overriden in a subclass
Expand Down
8 changes: 4 additions & 4 deletions services/web/client/source/class/qxapp/auth/ui/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
*/

members: {
__form: null,

// overrides base
__form: null,
_buildPage: function() {
this.__form = new qx.ui.form.Form();

Expand Down Expand Up @@ -137,9 +136,10 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {

let successFun = function(log) {
this.fireDataEvent("done", log.message);
// we don't need the form any more, so remove it
// we don't need the form any more, so remove it and mock-navigate-away
// and thus tell the password manager to save the content
this._form.dispose();
this._formElement.dispose();
window.history.replaceState(null, window.document.title, window.location.pathname);
};

let failFun = function(msg) {
Expand Down

0 comments on commit a8c7664

Please sign in to comment.