Fix JSHint errors
This commit is contained in:
parent
fdf86143b3
commit
f5630b9791
|
@ -1,8 +1,6 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
import ObjectController from 'discourse/controllers/object';
|
||||||
import { notificationUrl } from 'discourse/lib/desktop-notifications';
|
import { notificationUrl } from 'discourse/lib/desktop-notifications';
|
||||||
|
|
||||||
var INVITED_TYPE= 8;
|
|
||||||
|
|
||||||
export default ObjectController.extend({
|
export default ObjectController.extend({
|
||||||
|
|
||||||
scope: function() {
|
scope: function() {
|
||||||
|
|
|
@ -9,6 +9,7 @@ const focusTrackerKey = "focus-tracker";
|
||||||
const seenDataKey = "seen-notifications";
|
const seenDataKey = "seen-notifications";
|
||||||
const recentUpdateThreshold = 1000 * 60 * 2; // 2 minutes
|
const recentUpdateThreshold = 1000 * 60 * 2; // 2 minutes
|
||||||
const idleThresholdTime = 1000 * 10; // 10 seconds
|
const idleThresholdTime = 1000 * 10; // 10 seconds
|
||||||
|
const INVITED_TYPE = 8;
|
||||||
|
|
||||||
function init(container) {
|
function init(container) {
|
||||||
liveEnabled = false;
|
liveEnabled = false;
|
||||||
|
@ -27,7 +28,7 @@ function init(container) {
|
||||||
try {
|
try {
|
||||||
init2(container);
|
init2(container);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
Em.Logger.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
|
@ -71,6 +72,7 @@ function init2(container) {
|
||||||
primaryTab = false;
|
primaryTab = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("focus", function() {
|
window.addEventListener("focus", function() {
|
||||||
if (!primaryTab) {
|
if (!primaryTab) {
|
||||||
primaryTab = true;
|
primaryTab = true;
|
||||||
|
@ -78,14 +80,16 @@ function init2(container) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (document.hidden) {
|
if (document && (typeof document.hidden !== "undefined") && document["hidden"]) {
|
||||||
primaryTab = false;
|
primaryTab = false;
|
||||||
} else {
|
} else {
|
||||||
primaryTab = true;
|
primaryTab = true;
|
||||||
localStorage.setItem(focusTrackerKey, mbClientId);
|
localStorage.setItem(focusTrackerKey, mbClientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (document) {
|
||||||
document.addEventListener("scroll", resetIdle);
|
document.addEventListener("scroll", resetIdle);
|
||||||
|
}
|
||||||
window.addEventListener("mouseover", resetIdle);
|
window.addEventListener("mouseover", resetIdle);
|
||||||
Discourse.PageTracker.on("change", resetIdle);
|
Discourse.PageTracker.on("change", resetIdle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue