Skip to content

Commit

Permalink
Adds annotation button
Browse files Browse the repository at this point in the history
Resolves apache#75
  • Loading branch information
NejcZdovc committed Apr 16, 2021
1 parent 171f37c commit b9b4393
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions superset/static/blotout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ const modifyCheck = (func) => {
}

const modifyElements = () => {
switch (window.location.pathname) {
case '/databaseview/list/':
case '/tablemodelview/list/': {
// Add + button to source database and table pages
modifyCheck(() => {
if (window.location.pathname === '/databaseview/list/' ||
window.location.pathname === '/tablemodelview/list/' ||
window.location.pathname === '/annotationlayermodelview/list/' ||
window.location.pathname.startsWith('/annotationmodelview/')) {
modifyCheck(() => {
const elements = document.querySelectorAll('header nav .navbar-right .btn-primary')
if (elements.length === 0) {
return false
}
elements[0].style.display = 'inline-block'
return true
})
break
}
case '/users/userinfo/':
case '/users/show/': {
// remove reset password button from user page
modifyCheck(() => {
const elements = document.querySelectorAll('.panel-body .well .btn-primary')
if (elements.length === 0) {
return false
}
elements[0].style.display = 'none'
return true
})
}
return
}

if (window.location.pathname === '/users/userinfo/' ||
window.location.pathname === '/users/show/') {
// remove reset password button from user page
modifyCheck(() => {
const elements = document.querySelectorAll('.panel-body .well .btn-primary')
if (elements.length === 0) {
return false
}
elements[0].style.display = 'none'
return true
})
}
}

Expand Down

0 comments on commit b9b4393

Please sign in to comment.