mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 23:19:58 +02:00
Merge pull request #32 from skara9/emoji-first-char
Fix display of ZWJ Emojis as Workspace Icons
This commit is contained in:
commit
1dd4160831
1 changed files with 6 additions and 1 deletions
|
@ -127,7 +127,9 @@ var ZenWorkspaces = {
|
|||
}
|
||||
},
|
||||
|
||||
_kIcons: JSON.parse(Services.prefs.getStringPref("zen.workspaces.icons")).map((icon) => Array.from(icon)[0]),
|
||||
_kIcons: JSON.parse(Services.prefs.getStringPref("zen.workspaces.icons")).map((icon) => (
|
||||
(typeof Intl.Segmenter !== 'undefined') ? new Intl.Segmenter().segment(icon).containing().segment : Array.from(icon)[0]
|
||||
)),
|
||||
|
||||
_initializeWorkspaceCreationIcons() {
|
||||
let container = document.getElementById('PanelUI-zen-workspaces-create-icons-container');
|
||||
|
@ -248,6 +250,9 @@ var ZenWorkspaces = {
|
|||
if (this.workspaceHasIcon(workspace)) {
|
||||
return workspace.icon;
|
||||
}
|
||||
if (typeof Intl.Segmenter !== 'undefined') {
|
||||
return new Intl.Segmenter().segment(workspace.name).containing().segment.toUpperCase();
|
||||
}
|
||||
return Array.from(workspace.name)[0].toUpperCase();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue