Commit graph

15 commits

Author SHA1 Message Date
Ashwin Ramaswami
25d816f65a Clear dropdown width 2018-12-10 10:16:29 -08:00
chrisgarrity
30a6e67ffa
Handle RTL text ()
* Handle RTL text

Fixes issues related to dropdown menus (right align instead of left align), and bi-directional blocks (e.g., go to x: %1 y:%2, the ‘x: %1 y:%2’ is LTR, but should not be treated as LTR, when rendered in Hebrew it should be ‘%2 :y %1 :x’)

* Set dropdownDiv direction

Set the direction based on the rtl of the block that owns the menu.

Note the css for dropdowns is completely different from blockly (`float` vs `absolute`) as a result of this PR from a couple of years ago: https://github.com/LLK/scratch-blocks/pull/632/

*  use right-left-embed (rle) unicode to force RTL text, and left-right-embed for editing numbers.
2018-08-30 14:05:25 -04:00
Rachel Fenichel
fc0da3e070 All remaining lint in core 2018-05-02 15:32:28 -07:00
Katelyn Mann
fc9eff9f8a Fix bug with dropdowndiv placement. It was using getPage Offset to do positioning calculations. GetPageOffset takes into account the scroll position which we do not want. It is not noticable if the body has overflow:hidden like the playgrounds do. 2016-11-16 10:15:21 -08:00
picklesrus
3625093ce1 Cache height of the toolbox category box since it does not change. Also only call hideWithoutAnimation on the dropdown div if it is visible (Bug ). () 2016-10-20 22:28:54 -04:00
Airhogs777
d00c2942e4 Dropdown menu categories ()
* add getter for category

* set dropdown's data-category to parent block's category

* remove unused parameter
2016-10-03 08:17:45 -04:00
Tim Mickel
02a9a6d607 Position drop-down based on actual block dimensions ()
* Position drop-down based on actual block dimensions

* Calculate dropdown positioning based on actual field position
2016-09-30 13:36:29 -04:00
Tim Mickel
8ca49eb8f2 Fix for , ()
* Fix for , 

* Add drop-down hide when a block is clicked.
2016-08-16 15:18:36 -04:00
Airhogs777
b494a0365e make blocklyDropDownArrow inherit background-color and border-color () 2016-07-10 10:56:47 -04:00
Tim Mickel
25e80c2d09 Straw-man implementation of text drop-downs ()
* Refactor drop-down positioning to encapsulate block positioning

Moves block-positioning logic to the DropDownDiv class. Since icon menus use a special offset for the secondary mode, add an option for that.

* Swap out field_dropdown's use of WidgetDiv with DropDownDiv

* Update CSS for goog-menus in DropDownDivs

* Fix hiding behavior when showEditor_ is called again
2016-06-14 17:08:14 -04:00
Tim Mickel
827a6ee163 Restore animated drop-down with no collisions ()
* Restore animated drop-down with no collisions

* Update comment about drop-down transition workaround
2016-05-24 17:33:10 -04:00
Tim Mickel
601b042113 Fix by using page offset instead of client position 2016-05-09 17:57:11 -04:00
rachel-fenichel
e32a887911 Remove slide-in animation for dropdown div. () 2016-05-04 15:57:08 -04:00
Rodrigo Queiro
0ea1a4152d Add Apache 2.0 license header to new files
Files that were forked off Blockly (eg block_render_svg_horizontal.js)
remain marked as Copyright Google, whereas new files are Copyright MIT.
2016-04-25 15:34:22 +02:00
Tim Mickel
cf6725ba4c Implement drop-down menus and icon picker field ()
* Icon menu and drop-down stubs

* Recompile 4/15

* Fix stubs to draw shadow block for drop-down

* Fix rendering of shadow for icon menu

* Add arrow to dropdown button

* Add drop-down buttons to rest of examples

* Implementation of drop-down div including positioning

* Drop-downs take colours from the blocks

* Fix scaled secondary position of drop-downs

* Fix arrow positioning for RTL

* Use SVG parentNode for sizing dropdown

* Use transform for drop-down positioning

* Add basic DropDownDiv hide

* Add animation-in to dropdown

* More subtle drop-down animation and shadow

* Add icon menu example

* Use options style of Blockly FieldImage for drop-down

* Add default value for iconmenu

* Add example hover, active states for iconmenu buttons

* Update dropdown_icon example

* Implement icon-menu value handling and default value

* Add updating the parent block image field to dropdown

* Drop-down animates out; add hooks to hide for various Blockly happenings

* Add pointer cursor for drop-down icons

* Improve documentation for drop-downs and minor refactor

* Factor out getSrcForValue in iconmenu

* Blocks take on the icon of their icon-menu

* Add basic accessibility properties, similar to closure

* Remove extra drop-down example; update playgrounds

* Remove unnecessary colour overrides

* Add onHide, colour changing, fix references in dropdowndiv

* Flip arrow when the drop-down is rendered above

* Hide the icon menu drop-down on second tap of button

* Add preventDefault to button ontouchstart

* Updates to drop-down from Carl

* Add icon-menu placeholders and a crazy demo

* Fix naming to normalize (drop-down, DropDown)

* Add license header
2016-04-21 15:33:28 -04:00