🔧 Connect fire buttons only once
This commit is contained in:
+15
-10
@@ -117,17 +117,22 @@ var Fire = class {
|
|||||||
dialog.bindColorButton('fire-color-4');
|
dialog.bindColorButton('fire-color-4');
|
||||||
dialog.bindColorButton('fire-color-5');
|
dialog.bindColorButton('fire-color-5');
|
||||||
|
|
||||||
// The fire-gradient-reset button needs to be bound explicitly.
|
// Connect the buttons only once. The bindPreferences can be called multiple times...
|
||||||
dialog.getBuilder().get_object('reset-fire-colors').connect('clicked', () => {
|
if (!this._isConnected) {
|
||||||
dialog.getProfileSettings().reset('fire-color-1');
|
this._isConnected = true;
|
||||||
dialog.getProfileSettings().reset('fire-color-2');
|
|
||||||
dialog.getProfileSettings().reset('fire-color-3');
|
|
||||||
dialog.getProfileSettings().reset('fire-color-4');
|
|
||||||
dialog.getProfileSettings().reset('fire-color-5');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initialize the fire-preset dropdown.
|
// The fire-gradient-reset button needs to be bound explicitly.
|
||||||
this._createFirePresets(dialog);
|
dialog.getBuilder().get_object('reset-fire-colors').connect('clicked', () => {
|
||||||
|
dialog.getProfileSettings().reset('fire-color-1');
|
||||||
|
dialog.getProfileSettings().reset('fire-color-2');
|
||||||
|
dialog.getProfileSettings().reset('fire-color-3');
|
||||||
|
dialog.getProfileSettings().reset('fire-color-4');
|
||||||
|
dialog.getProfileSettings().reset('fire-color-5');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initialize the fire-preset dropdown.
|
||||||
|
this._createFirePresets(dialog);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- API for extension.js
|
// ---------------------------------------------------------------- API for extension.js
|
||||||
|
|||||||
Reference in New Issue
Block a user