Skip to content

Commit

Permalink
Reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommimon committed Jan 7, 2023
1 parent b3aed1e commit 407345c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ function disable () {
// Reset the menu to the standard one (without new item)
AppDisplay.AppIcon.prototype.popupMenu = oldPopupMenu;
}

8 changes: 4 additions & 4 deletions shortcutMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ function insertAddToDesktopButton(menu) {
});
let itemsArray = menu._getMenuItems();
let pos = -1;
for(let i = itemsArray.length-1; i >= 0; i--) {
for (let i = itemsArray.length-1; i >= 0; i--) {
let item = itemsArray[i];
// check class because there are also separators or other things
if(item instanceof PopupMenu.PopupMenuItem) {
if (item instanceof PopupMenu.PopupMenuItem) {
let label = item.label.get_text();
if(nameArray.includes(label)) {
if (nameArray.includes(label)) {
pos = i;
}
}
}

let label = _('Add to Desktop');
item = new PopupMenu.PopupMenuItem(label);
if(pos === -1) {
if (pos === -1) {
menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
menu.addMenuItem(item); // add at the end
}
Expand Down

0 comments on commit 407345c

Please sign in to comment.