@translifycc/angular 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -151,8 +151,17 @@ export class TranslifySelectorComponent implements OnInit, OnDestroy {
|
|
|
151
151
|
@Input() apiKey!: string;
|
|
152
152
|
@Input() apiBase = 'https://translify.cc';
|
|
153
153
|
@Input() domain = window.location.hostname || 'localhost';
|
|
154
|
-
@Input() classNames:
|
|
155
|
-
|
|
154
|
+
@Input() classNames: {
|
|
155
|
+
trigger?: string; dropdown?: string; dropdownHeader?: string;
|
|
156
|
+
option?: string; optionActive?: string; optionNative?: string;
|
|
157
|
+
optionName?: string; optionRtl?: string; restore?: string;
|
|
158
|
+
overlay?: string; overlaySpinner?: string; overlayTitle?: string;
|
|
159
|
+
overlaySub?: string; toast?: string;
|
|
160
|
+
} = {};
|
|
161
|
+
@Input() labels: {
|
|
162
|
+
trigger?: string; dropdownHeader?: string; restore?: string;
|
|
163
|
+
overlayTitle?: string; overlaySub?: string;
|
|
164
|
+
} = {};
|
|
156
165
|
|
|
157
166
|
languages: Language[] = [];
|
|
158
167
|
activeLang: string | null = getSavedLang();
|
|
@@ -352,9 +361,10 @@ export class TranslifySelectorComponent implements OnInit, OnDestroy {
|
|
|
352
361
|
|
|
353
362
|
private patchHistory() {
|
|
354
363
|
const orig = history.pushState.bind(history);
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
364
|
+
const self = this;
|
|
365
|
+
history.pushState = function(state: unknown, unused: string, url?: string | URL | null) {
|
|
366
|
+
orig(state, unused, url);
|
|
367
|
+
self.onRouteChange();
|
|
358
368
|
};
|
|
359
369
|
window.addEventListener('popstate', () => this.onRouteChange());
|
|
360
370
|
}
|