Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
remove old dashboard code
Browse files Browse the repository at this point in the history
  • Loading branch information
muan committed May 7, 2019
1 parent a0f3a9e commit a160536
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,13 @@ function init () {
details.appendChild(summary)
details.appendChild(container)

const newDashboard = document.querySelector('.page-responsive [data-src*="/dashboard/recent-activity"], .js-recent-activity-container')
const oldDashboard = document.querySelector('.news')
if (newDashboard) {
newDashboard.after(details)
} else if(oldDashboard) {
// org or user condition
summary.classList.remove('btn-sm')
details.classList.add(context === 'org' ? 'mt-3' : 'mt-5')

oldDashboard.prepend(details)
const positionMarker = document.querySelector('.js-all-activity-header')
if (positionMarker) {
positionMarker.before(details)
applyPreference()
} else {
console.log('Dashboard extension: position marker not found.')
}

if (newDashboard || oldDashboard) applyPreference()
}

function rememberPreference () {
Expand Down

0 comments on commit a160536

Please sign in to comment.