| 140 | } |
| 141 | |
| 142 | bool tooltip::ToolTipController::OnPressEnd(event::Event &event) { |
| 143 | chart_->GetLogTracer()->trace("%s", "#ToolTipController onPressend"); |
| 144 | |
| 145 | if (isTooltips()) { |
| 146 | if (configs_[0].contains("onPressEnd") && configs_[0]["onPressEnd"].is_string()) { |
| 147 | chart_->InvokeFunction(configs_[0]["onPressEnd"]); |
| 148 | } |
| 149 | |
| 150 | bool ret = false; |
| 151 | for_each(this->toolTips_.begin(), this->toolTips_.end(), [&](auto &tooltip) { |
| 152 | if (tooltip.get() != nullptr) { |
| 153 | ret = true; |
| 154 | } |
| 155 | }); |
| 156 | if (ret == false) { |
| 157 | return false; |
| 158 | } |
| 159 | } else { |
| 160 | if (config_.contains("onPressEnd") && config_["onPressEnd"].is_string()) { |
| 161 | chart_->InvokeFunction(config_["onPressEnd"]); |
| 162 | } |
| 163 | |
| 164 | if (this->toolTip_.get() == nullptr) { |
| 165 | return false; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | return this->HideToolTip(); |
| 170 | } |
| 171 | |
| 172 | void tooltip::ToolTipController::OnRender() { |
| 173 | if (isTooltips()) { |
nothing calls this directly
no test coverage detected