Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Change order of topSites actions to PIN-BM-CLOSE #5410

Merged
merged 2 commits into from
Nov 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions app/common/state/aboutNewTabState.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ const aboutNewTabState = {
return state
}

// Remove tags since we've verified this is a bookmark/history item
// NOTE: siteUtil.removeSite won't delete the entry unless tags are missing
siteDetail = siteDetail.delete('tags')

// Keep track of the last 18 visited sites
let sites = state.getIn(['about', 'newtab', 'sites']) || new Immutable.List()
sites = sites.unshift(siteDetail)
Expand All @@ -57,7 +53,7 @@ const aboutNewTabState = {
// |
// V
// .sort(suggestion.sortByAccessCountWithAgeDecay)
sites = siteUtil.addSite(sites, siteDetail, undefined, props.originalSiteDetail)
sites = siteUtil.addSite(sites, siteDetail, props.tag, props.originalSiteDetail)
state = state.setIn(['about', 'newtab', 'sites'], sites)
return state.setIn(['about', 'newtab', 'updatedStamp'], new Date().getTime())
},
Expand All @@ -74,9 +70,11 @@ const aboutNewTabState = {
return state
}

// Remove tags since we've verified this is a bookmark/history item
// Remove tags if this is a history item.
// NOTE: siteUtil.removeSite won't delete the entry unless tags are missing
siteDetail = siteDetail.delete('tags')
if (siteDetail.get('tags') && siteDetail.get('tags').size === 0) {
siteDetail = siteDetail.delete('tags')
}

const sites = state.getIn(['about', 'newtab', 'sites'])
state = state.setIn(['about', 'newtab', 'sites'], siteUtil.removeSite(sites, siteDetail, undefined))
Expand Down
12 changes: 6 additions & 6 deletions js/about/newTabComponents/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ class Block extends ImmutableComponent {
className={cx({
topSitesActionBtn: true,
fa: true,
[starIcon]: true
[pinIcon]: true
})}
onClick={onToggleBookmark}
data-l10n-id={isBookmarked ? 'removeBookmarkButton' : 'addBookmarkButton'}
onClick={onPinnedTopSite}
data-l10n-id={isPinned ? 'pinTopSiteButton' : 'unpinTopSiteButton'}
/>
<button
className={cx({
topSitesActionBtn: true,
fa: true,
[pinIcon]: true
[starIcon]: true
})}
onClick={onPinnedTopSite}
data-l10n-id={isPinned ? 'pinTopSiteButton' : 'unpinTopSiteButton'}
onClick={onToggleBookmark}
data-l10n-id={isBookmarked ? 'removeBookmarkButton' : 'addBookmarkButton'}
/>
<button
className='topSitesActionBtn fa fa-close'
Expand Down
2 changes: 1 addition & 1 deletion less/about/newtab.less
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ ul {
visibility: visible;
position: absolute;
top: 4px;
right: 4px;
left: 4px;
width: 20px;
height: 20px;
background-color: @gray25;
Expand Down