Ghost/ghost/admin/app/services
Emilio Cobos Álvarez 28b5f7de52 🐛 Fixed night shift toggle in Firefox Nightly. (#1174)
Over in:

 * https://github.com/whatwg/html/issues/3840
 * https://bugzilla.mozilla.org/show_bug.cgi?id=1281135

I'm trying to come up with a model for `<link rel="stylesheet" disabled>` in
which Blink / WebKit and Firefox can agree on.

See that HTML spec issue for all the inconsistencies of WebKit / Blink, and the
following post for more context:

 * https://groups.google.com/d/msg/mozilla.dev.platform/BdgNaChHnpY/mhXzCBwSCgAJ

---

Unfortunately, my change to Firefox breaks the Ghost Admin panel night-mode
switch (you can see it in Firefox Nightly).

This is because with my change, removing the `disabled` attribute from an
stylesheet behaves the same regardless of whether the `disabled` attribute is
added dynamically or not.

That means that adding the `disabled` attribute dynamically "unloads" the
stylesheet completely (just like when the attribute is there before inserting
the link in the document, or from the parser). Thus removing the attribute will
load the stylesheet again and fire a load event.

This is problematic for the code as-is, because it means that each time that the
load event fires when the disabled attribute is removed on an alternate, then
it's added again. :)

Prevent that from happening by removing the load event listener ASAP. What this
code wants is to only resolve the promise once after all.

Given this is so far the only regression from my change that has been reported
(over at https://bugzilla.mozilla.org/show_bug.cgi?id=1546707), I think fixing
the Ghost-Admin panel is worth it.

If this pattern is somehow common, then we'll probably revert that patch and go
back to the sad current state of affairs regarding interop :(
2019-04-25 09:40:26 +02:00
..
ajax.js 🐛 Fixed missing error notification when attempting to activate an invalid theme 2019-03-25 11:32:29 +00:00
clock.js Remove more import Ember via module imports 2018-05-03 17:52:39 +01:00
config.js Removed usage of /configuration/timezones/ endpoint 2019-02-26 12:37:50 +07:00
dropdown.js Switched from ember-cli-shims to new module imports (#779) 2017-08-22 14:53:26 +07:00
event-bus.js Switched from ember-cli-shims to new module imports (#779) 2017-08-22 14:53:26 +07:00
feature.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00
ghost-paths.js 🐛 Fixed low-resolution gravatar images on Team/User screens 2018-05-14 12:15:08 +01:00
lazy-loader.js 🐛 Fixed night shift toggle in Firefox Nightly. (#1174) 2019-04-25 09:40:26 +02:00
media-queries.js Unsplash integration 2017-08-15 16:01:12 +01:00
media.js Bumped dependencies (#1108) 2019-03-05 17:34:00 +00:00
notifications.js Fixed notificaitons.displayDelayed() throwing an error 2019-03-25 12:28:14 +00:00
resize-detector.js Switch from embor-browserify to ember-auto-import 2019-01-22 13:09:38 +00:00
session.js 🐛 Fixed error after logging in from a nested admin URL 2019-03-25 13:01:58 +00:00
settings.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00
slug-generator.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00
tour.js View site inside Ghost Admin 2019-03-21 10:33:14 +01:00
ui.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00
unsplash.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00
upgrade-status.js Refactored usage of .get('property') with es5 getters 2019-03-06 13:54:14 +00:00