mirror of
https://github.com/google/blockly.git
synced 2026-01-11 02:47:09 +01:00
Migrate core/toolbox/toolbox_item.js to goog.module
This commit is contained in:
@@ -10,12 +10,14 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.ToolboxItem');
|
||||
goog.module('Blockly.ToolboxItem');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
goog.require('Blockly.IToolboxItem');
|
||||
|
||||
goog.requireType('Blockly.ICollapsibleToolboxItem');
|
||||
goog.requireType('Blockly.IToolbox');
|
||||
goog.require('Blockly.utils.IdGenerator');
|
||||
goog.requireType('Blockly.utils.toolbox');
|
||||
goog.requireType('Blockly.WorkspaceSvg');
|
||||
|
||||
@@ -30,7 +32,7 @@ goog.requireType('Blockly.WorkspaceSvg');
|
||||
* @constructor
|
||||
* @implements {Blockly.IToolboxItem}
|
||||
*/
|
||||
Blockly.ToolboxItem = function(toolboxItemDef, toolbox, opt_parent) {
|
||||
const ToolboxItem = function(toolboxItemDef, toolbox, opt_parent) {
|
||||
|
||||
/**
|
||||
* The id for the category.
|
||||
@@ -81,7 +83,7 @@ Blockly.ToolboxItem = function(toolboxItemDef, toolbox, opt_parent) {
|
||||
* on the info object.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.init = function() {
|
||||
ToolboxItem.prototype.init = function() {
|
||||
// No-op by default.
|
||||
};
|
||||
|
||||
@@ -90,7 +92,7 @@ Blockly.ToolboxItem.prototype.init = function() {
|
||||
* @return {?Element} The div for the toolbox item.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.getDiv = function() {
|
||||
ToolboxItem.prototype.getDiv = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -99,7 +101,7 @@ Blockly.ToolboxItem.prototype.getDiv = function() {
|
||||
* @return {string} The ID for the toolbox item.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.getId = function() {
|
||||
ToolboxItem.prototype.getId = function() {
|
||||
return this.id_;
|
||||
};
|
||||
|
||||
@@ -109,7 +111,7 @@ Blockly.ToolboxItem.prototype.getId = function() {
|
||||
* this toolbox item is not nested.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.getParent = function() {
|
||||
ToolboxItem.prototype.getParent = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -118,7 +120,7 @@ Blockly.ToolboxItem.prototype.getParent = function() {
|
||||
* @return {number} The nested level of the category.
|
||||
* @package
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.getLevel = function() {
|
||||
ToolboxItem.prototype.getLevel = function() {
|
||||
return this.level_;
|
||||
};
|
||||
|
||||
@@ -127,7 +129,7 @@ Blockly.ToolboxItem.prototype.getLevel = function() {
|
||||
* @return {boolean} True if the toolbox item can be selected.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.isSelectable = function() {
|
||||
ToolboxItem.prototype.isSelectable = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -136,7 +138,7 @@ Blockly.ToolboxItem.prototype.isSelectable = function() {
|
||||
* @return {boolean} True if the toolbox item is collapsible.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.isCollapsible = function() {
|
||||
ToolboxItem.prototype.isCollapsible = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -144,5 +146,7 @@ Blockly.ToolboxItem.prototype.isCollapsible = function() {
|
||||
* Dispose of this toolbox item. No-op by default.
|
||||
* @public
|
||||
*/
|
||||
Blockly.ToolboxItem.prototype.dispose = function() {
|
||||
ToolboxItem.prototype.dispose = function() {
|
||||
};
|
||||
|
||||
exports = ToolboxItem;
|
||||
|
||||
@@ -172,7 +172,7 @@ goog.addDependency('../../core/toolbox/category.js', ['Blockly.ToolboxCategory']
|
||||
goog.addDependency('../../core/toolbox/collapsible_category.js', ['Blockly.CollapsibleToolboxCategory'], ['Blockly.ICollapsibleToolboxItem', 'Blockly.ToolboxCategory', 'Blockly.ToolboxSeparator', 'Blockly.registry', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/toolbox/separator.js', ['Blockly.ToolboxSeparator'], ['Blockly.IToolboxItem', 'Blockly.ToolboxItem', 'Blockly.registry', 'Blockly.utils.dom'], {'lang': 'es5'});
|
||||
goog.addDependency('../../core/toolbox/toolbox.js', ['Blockly.Toolbox'], ['Blockly.BlockSvg', 'Blockly.CollapsibleToolboxCategory', 'Blockly.ComponentManager', 'Blockly.Css', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.ToolboxItemSelect', 'Blockly.IAutoHideable', 'Blockly.IKeyboardAccessible', 'Blockly.IStyleable', 'Blockly.IToolbox', 'Blockly.Options', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.constants', 'Blockly.registry', 'Blockly.utils', 'Blockly.utils.Rect', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.toolbox'], {'lang': 'es5'});
|
||||
goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'], ['Blockly.IToolboxItem']);
|
||||
goog.addDependency('../../core/toolbox/toolbox_item.js', ['Blockly.ToolboxItem'], ['Blockly.IToolboxItem', 'Blockly.utils.IdGenerator'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.browserEvents', 'Blockly.utils.string']);
|
||||
goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.internalConstants', 'Blockly.utils', 'Blockly.utils.global', 'Blockly.utils.string']);
|
||||
goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object']);
|
||||
|
||||
Reference in New Issue
Block a user