highlight edit chart

This commit is contained in:
devezhao-mac 2019-01-04 02:16:44 +08:00
parent 506061a312
commit 147b3a08cf
4 changed files with 13 additions and 4 deletions

View file

@ -4,7 +4,7 @@
.rb-offcanvas-menu .rb-top-header .rb-navbar-header .rb-toggle-left-sidebar:hover {
opacity: 0.8;
}
.rb-top-header .rb-navbar-header .navbar-brand {
.rb-top-header .rb-navbar-header {
cursor: default;
}

View file

@ -2,6 +2,9 @@
height: 100%;
padding: 20px 25px;
}
.chart-box.high {
outline: 2px solid #4285f4;
}
.chart-box .chart-body {
height: 100%;

View file

@ -57,7 +57,6 @@ $(document).ready(() => {
render_option()
})
$('.navbar-brand').removeAttr('href')
$('.rb-toggle-left-sidebar').attr('title', '完成').off('click').on('click', () => {
let cfg = build_config()
if (!!!cfg){
@ -70,8 +69,8 @@ $(document).ready(() => {
let dash = $urlp('dashid') || ''
$.post(rb.baseUrl + '/dashboard/chart-save?dashid=' + dash, JSON.stringify(_data), function(res){
if (res.error_code == 0){
window.__chartId = res.data.id
location.href = !!dash ? ('home?d=' + dash) : 'home'
// window.__chartId = res.data.id
location.href = (!!dash ? ('home?d=' + dash) : 'home') + '#' + res.data.id
} else rb.notice(res.error_msg, 'danger')
})

View file

@ -26,6 +26,13 @@ $(document).ready(function(){
render_dashboard(d[2])
$('.dash-list h4').text(d[1])
if (location.hash){
let high = $('#chart-' + location.hash.substr(1) + ' > .chart-box').addClass('high')
high.on('mouseleave', ()=>{
high.removeClass('high')
})
}
//
if (dashid_self) $('.J_dash-new').remove()
else $('.J_dash-edit').remove()