mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Check if WidgetDiv is visible before hide logic. (#3716)
This commit is contained in:
@@ -91,16 +91,19 @@ Blockly.WidgetDiv.show = function(newOwner, rtl, dispose) {
|
|||||||
* Destroy the widget and hide the div.
|
* Destroy the widget and hide the div.
|
||||||
*/
|
*/
|
||||||
Blockly.WidgetDiv.hide = function() {
|
Blockly.WidgetDiv.hide = function() {
|
||||||
var div = Blockly.WidgetDiv.DIV;
|
if (!Blockly.WidgetDiv.isVisible()) {
|
||||||
if (Blockly.WidgetDiv.owner_) {
|
return;
|
||||||
Blockly.WidgetDiv.owner_ = null;
|
|
||||||
div.style.display = 'none';
|
|
||||||
div.style.left = '';
|
|
||||||
div.style.top = '';
|
|
||||||
Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_();
|
|
||||||
Blockly.WidgetDiv.dispose_ = null;
|
|
||||||
div.innerHTML = '';
|
|
||||||
}
|
}
|
||||||
|
Blockly.WidgetDiv.owner_ = null;
|
||||||
|
|
||||||
|
var div = Blockly.WidgetDiv.DIV;
|
||||||
|
div.style.display = 'none';
|
||||||
|
div.style.left = '';
|
||||||
|
div.style.top = '';
|
||||||
|
Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_();
|
||||||
|
Blockly.WidgetDiv.dispose_ = null;
|
||||||
|
div.innerHTML = '';
|
||||||
|
|
||||||
if (Blockly.WidgetDiv.rendererClassName_) {
|
if (Blockly.WidgetDiv.rendererClassName_) {
|
||||||
Blockly.utils.dom.removeClass(div, Blockly.WidgetDiv.rendererClassName_);
|
Blockly.utils.dom.removeClass(div, Blockly.WidgetDiv.rendererClassName_);
|
||||||
Blockly.WidgetDiv.rendererClassName_ = null;
|
Blockly.WidgetDiv.rendererClassName_ = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user