зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 772c30e9e812 (bug 944255) for mochitest-mc orange.
This commit is contained in:
Родитель
025d9c3084
Коммит
f22ee0eab8
|
@ -27,18 +27,18 @@ function makeURI(aURL, aOriginCharset, aBaseURI) {
|
||||||
function View(aSet) {
|
function View(aSet) {
|
||||||
this._set = aSet;
|
this._set = aSet;
|
||||||
this._set.controller = this;
|
this._set.controller = this;
|
||||||
this._window = aSet.ownerDocument.defaultView;
|
|
||||||
|
|
||||||
this.onResize = () => this._adjustDOMforViewState();
|
|
||||||
this._window.addEventListener("resize", this.onResize);
|
|
||||||
|
|
||||||
|
this.viewStateObserver = {
|
||||||
|
observe: (aSubject, aTopic, aData) => this._adjustDOMforViewState(aData)
|
||||||
|
};
|
||||||
|
Services.obs.addObserver(this.viewStateObserver, "metro_viewstate_changed", false);
|
||||||
ColorUtils.init();
|
ColorUtils.init();
|
||||||
this._adjustDOMforViewState();
|
this._adjustDOMforViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
View.prototype = {
|
View.prototype = {
|
||||||
destruct: function () {
|
destruct: function () {
|
||||||
this._window.removeEventListener("resize", this.onResize);
|
Services.obs.removeObserver(this.viewStateObserver, "metro_viewstate_changed");
|
||||||
},
|
},
|
||||||
|
|
||||||
_adjustDOMforViewState: function _adjustDOMforViewState(aState) {
|
_adjustDOMforViewState: function _adjustDOMforViewState(aState) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче