mirror of
https://github.com/google/blockly.git
synced 2026-01-14 04:17:10 +01:00
Rebuild again
This commit is contained in:
@@ -973,8 +973,8 @@ Blockly.Toolbox.prototype.addToolboxItem_=function(a){this.contents_.push(a);thi
|
||||
Blockly.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv)return null;var a=this.HtmlDiv.getBoundingClientRect(),b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition==Blockly.utils.toolbox.Position.TOP?new Blockly.utils.Rect(-1E7,c,-1E7,1E7):this.toolboxPosition==Blockly.utils.toolbox.Position.BOTTOM?new Blockly.utils.Rect(b,1E7,-1E7,1E7):this.toolboxPosition==Blockly.utils.toolbox.Position.LEFT?new Blockly.utils.Rect(-1E7,1E7,-1E7,a):new Blockly.utils.Rect(-1E7,1E7,d,1E7)};
|
||||
Blockly.Toolbox.prototype.getToolboxItemById=function(a){return this.contentMap_[a]};Blockly.Toolbox.prototype.getWidth=function(){return this.width_};Blockly.Toolbox.prototype.getHeight=function(){return this.height_};Blockly.Toolbox.prototype.getFlyout=function(){return this.flyout_};Blockly.Toolbox.prototype.getWorkspace=function(){return this.workspace_};Blockly.Toolbox.prototype.getSelectedItem=function(){return this.selectedItem_};Blockly.Toolbox.prototype.getPreviouslySelectedItem=function(){return this.previouslySelectedItem_};
|
||||
Blockly.Toolbox.prototype.isHorizontal=function(){return this.horizontalLayout_};Blockly.Toolbox.prototype.position=function(){var a=this.HtmlDiv;a&&(this.horizontalLayout_?(a.style.left="0",a.style.height="auto",a.style.width="100%",this.height_=a.offsetHeight,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.style.top="0":a.style.bottom="0"):(this.toolboxPosition==Blockly.TOOLBOX_AT_RIGHT?a.style.right="0":a.style.left="0",a.style.height="100%",this.width_=a.offsetWidth),this.flyout_.position())};
|
||||
Blockly.Toolbox.prototype.handleToolboxItemResize=function(){var a=this.workspace_,b=this.HtmlDiv.getBoundingClientRect();a.translate(this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?a.scrollX+b.width:0,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.scrollY+b.height:0);Blockly.svgResize(a)};Blockly.Toolbox.prototype.clearSelection=function(){this.setSelectedItem(null)};Blockly.Toolbox.prototype.refreshTheme=function(){for(var a=0;a<this.contents_.length;a++){var b=this.contents_[a];b.refreshTheme&&b.refreshTheme()}};
|
||||
Blockly.Toolbox.prototype.refreshSelection=function(){this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length&&this.flyout_.show(this.selectedItem_.getContents())};Blockly.Toolbox.prototype.setVisible=function(a){this.HtmlDiv.style.display=a?"block":"none"};
|
||||
Blockly.Toolbox.prototype.handleToolboxItemResize=function(){var a=this.workspace_,b=this.HtmlDiv.getBoundingClientRect();a.translate(this.toolboxPosition==Blockly.TOOLBOX_AT_LEFT?a.scrollX+b.width:a.scrollX,this.toolboxPosition==Blockly.TOOLBOX_AT_TOP?a.scrollY+b.height:a.scrollY);Blockly.svgResize(a)};Blockly.Toolbox.prototype.clearSelection=function(){this.setSelectedItem(null)};
|
||||
Blockly.Toolbox.prototype.refreshTheme=function(){for(var a=0;a<this.contents_.length;a++){var b=this.contents_[a];b.refreshTheme&&b.refreshTheme()}};Blockly.Toolbox.prototype.refreshSelection=function(){this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length&&this.flyout_.show(this.selectedItem_.getContents())};Blockly.Toolbox.prototype.setVisible=function(a){this.HtmlDiv.style.display=a?"block":"none"};
|
||||
Blockly.Toolbox.prototype.setSelectedItem=function(a){var b=this.selectedItem_;!a&&!b||a&&!a.isSelectable()||(this.shouldDeselectItem_(b,a)&&null!=b&&this.deselectItem_(b),this.shouldSelectItem_(b,a)&&null!=a&&this.selectItem_(b,a),this.updateFlyout_(b,a),this.fireSelectEvent_(b,a))};Blockly.Toolbox.prototype.shouldDeselectItem_=function(a,b){return null!=a&&(!a.isCollapsible()||a!=b)};Blockly.Toolbox.prototype.shouldSelectItem_=function(a,b){return null!=b&&b!=a};
|
||||
Blockly.Toolbox.prototype.deselectItem_=function(a){this.selectedItem_=null;this.previouslySelectedItem_=a;a.setSelected(!1);Blockly.utils.aria.setState(this.contentsDiv_,Blockly.utils.aria.State.ACTIVEDESCENDANT,"")};Blockly.Toolbox.prototype.selectItem_=function(a,b){this.selectedItem_=b;this.previouslySelectedItem_=a;b.setSelected(!0);Blockly.utils.aria.setState(this.contentsDiv_,Blockly.utils.aria.State.ACTIVEDESCENDANT,b.getId())};
|
||||
Blockly.Toolbox.prototype.selectItemByPosition=function(a){-1<a&&a<this.contents_.length&&(a=this.contents_[a],a.isSelectable()&&this.setSelectedItem(a))};Blockly.Toolbox.prototype.updateFlyout_=function(a,b){(a!=b||b.isCollapsible())&&b&&b.getContents().length?(this.flyout_.show(b.getContents()),this.flyout_.scrollToStart()):this.flyout_.hide()};
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user