@@ -15,12 +15,6 @@ class FieldTurtle extends Blockly.Field {
1515 // (for backwards compatibility reasons serializable is false by default).
1616 SERIALIZABLE = true ;
1717
18- // The cursor property defines what the mouse will look like when the user
19- // hovers over the field. By default the cursor will be whatever
20- // .blocklyDraggable's cursor is defined as (vis. grab). Most fields define
21- // this property as 'default'.
22- CURSOR = 'pointer' ;
23-
2418 // How far to move the text to keep it to the right of the turtle.
2519 // May change if the turtle gets fancy enough.
2620 TEXT_OFFSET_X = 80 ;
@@ -90,33 +84,16 @@ class FieldTurtle extends Blockly.Field {
9084 // textElement_ (text) we can call the super-function. If we only wanted
9185 // one or the other, we could call their individual createX functions.
9286 super . initView ( ) ;
87+ if ( this . fieldGroup_ ) {
88+ Blockly . utils . dom . addClass ( this . fieldGroup_ , 'turtleField' ) ;
89+ }
9390
9491 // Note that the field group is created by the abstract field's init_
9592 // function. This means that *all elements* should be children of the
9693 // fieldGroup_.
9794 this . createView_ ( ) ;
9895 }
9996
100- // Updates how the field looks depending on if it is editable or not.
101- updateEditable ( ) {
102- if ( ! this . fieldGroup_ ) {
103- // Not initialized yet.
104- return ;
105- }
106- // The default functionality just makes it so the borderRect_ does not
107- // highlight when hovered.
108- super . updateEditable ( ) ;
109- // Things like this are best applied to the clickTarget_. By default the
110- // click target is the same as getSvgRoot, which by default is the
111- // fieldGroup_.
112- const group = this . getClickTarget_ ( ) ;
113- if ( ! this . isCurrentlyEditable ( ) ) {
114- group . style . cursor = 'not-allowed' ;
115- } else {
116- group . style . cursor = this . CURSOR ;
117- }
118- }
119-
12097 // Gets the text to display when the block is collapsed
12198 getText ( ) {
12299 let text = this . value_ . turtleName + ' wearing a ' + this . value_ . hat ;
@@ -403,7 +380,7 @@ class FieldTurtle extends Blockly.Field {
403380 } ;
404381
405382 const widget = document . createElement ( 'div' ) ;
406- widget . className = 'customFieldsTurtleWidget blocklyNonSelectable ' ;
383+ widget . className = 'customFieldsTurtleWidget' ;
407384
408385 const table = document . createElement ( 'div' ) ;
409386 table . className = 'table' ;
0 commit comments