merge master

This commit is contained in:
antelle 2019-02-04 20:11:04 +01:00
commit 3927d8b1ab
8 changed files with 24 additions and 12 deletions

View File

@ -1,3 +1,4 @@
const Backbone = require('backbone');
const FeatureDetector = require('../util/feature-detector');
const Launcher = require('../comp/launcher');
@ -5,10 +6,14 @@ const FocusDetector = {
init() {
this.isFocused = true;
this.detectsFocusWithEvents = !FeatureDetector.isDesktop && !FeatureDetector.isMobile;
if (this.detectsFocusWithEvents) {
window.onblur = () => { this.isFocused = false; };
window.onfocus = () => { this.isFocused = true; };
}
window.onfocus = () => {
this.isFocused = true;
Backbone.trigger('focus');
};
window.onblur = () => {
this.isFocused = false;
Backbone.trigger('blur');
};
},
hasFocus() {

View File

@ -292,7 +292,7 @@ const Plugin = Backbone.Model.extend(_.extend({}, PluginStatus, {
const locKey = this.getThemeLocaleKey(theme.name);
SettingsManager.allThemes[theme.name] = locKey;
BaseLocale[locKey] = theme.title;
for (const styleSheet of document.styleSheets) {
for (const styleSheet of Array.from(document.styleSheets)) {
if (styleSheet.ownerNode.id === id) {
this.processThemeStyleSheet(styleSheet, theme);
break;
@ -306,7 +306,7 @@ const Plugin = Backbone.Model.extend(_.extend({}, PluginStatus, {
processThemeStyleSheet(styleSheet, theme) {
const themeSelector = '.th-' + theme.name;
const badSelectors = [];
for (const rule of styleSheet.cssRules) {
for (const rule of Array.from(styleSheet.cssRules)) {
if (rule.selectorText && rule.selectorText.lastIndexOf(themeSelector, 0) !== 0) {
badSelectors.push(rule.selectorText);
}

View File

@ -69,6 +69,7 @@ const OpenView = Backbone.View.extend({
KeyHandler.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress, this);
KeyHandler.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown, this);
KeyHandler.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp, this);
this.listenTo(Backbone, 'focus', this.windowFocused.bind(this));
},
render: function () {
@ -105,10 +106,12 @@ const OpenView = Backbone.View.extend({
return this;
},
windowFocused: function() {
this.inputEl.focus();
},
focusInput: function() {
console.log('focus');
if (FocusDetector.hasFocus()) {
console.log('hasFocus');
this.inputEl.focus();
}
},

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.7.4",
"version": "1.7.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.7.4",
"version": "1.7.5",
"description": "Free cross-platform password manager compatible with KeePass",
"main": "main.js",
"homepage": "https://keeweb.info",

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "1.7.4",
"version": "1.7.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "1.7.4",
"version": "1.7.5",
"description": "Free cross-platform password manager compatible with KeePass",
"main": "Gruntfile.js",
"private": true,

View File

@ -1,5 +1,9 @@
Release notes
-------------
##### v1.7.5 (2019-02-04)
`-` fix #1096: focus issues after minimizing
`-` fix #1094: plugin installation in MS Edge
##### v1.7.4 (2019-01-17)
`-` fix #423: input focus issues in desktop apps