mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Bugfix/no cursors on touch (#212)
* Don't switch mouse cursor on mobile * Add goog.userAgent to require
This commit is contained in:
parent
8cba76df19
commit
0408c9f695
1 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,7 @@ goog.provide('Blockly.Css');
|
|||
|
||||
goog.require('Blockly.Colours');
|
||||
|
||||
goog.require('goog.userAgent');
|
||||
|
||||
/**
|
||||
* List of cursors.
|
||||
|
@ -100,6 +101,11 @@ Blockly.Css.inject = function(hasCss, pathToMedia) {
|
|||
* @param {Blockly.Css.Cursor} cursor Enum.
|
||||
*/
|
||||
Blockly.Css.setCursor = function(cursor) {
|
||||
if (goog.userAgent.MOBILE || goog.userAgent.ANDROID || goog.userAgent.IPAD) {
|
||||
// Don't try to switch the mouse cursor on a mobile device.
|
||||
// This is an optimization - since we almost never have cursors on mobile anyway.
|
||||
return;
|
||||
}
|
||||
if (Blockly.Css.currentCursor_ == cursor) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue