mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Don't treat ctrl-click as a right-click except on Mac.
This commit is contained in:
@@ -551,10 +551,10 @@ Blockly.removeAllRanges = function() {
|
||||
* @private
|
||||
*/
|
||||
Blockly.isTargetInput_ = function(e) {
|
||||
return e.target.type == 'textarea' || e.target.type == 'text'
|
||||
|| e.target.type == 'number' || e.target.type == 'email'
|
||||
|| e.target.type == 'password' || e.target.type == 'search'
|
||||
|| e.target.type == 'tel' || e.target.type == 'url';
|
||||
return e.target.type == 'textarea' || e.target.type == 'text' ||
|
||||
e.target.type == 'number' || e.target.type == 'email' ||
|
||||
e.target.type == 'password' || e.target.type == 'search' ||
|
||||
e.target.type == 'tel' || e.target.type == 'url';
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
goog.provide('Blockly.utils');
|
||||
|
||||
goog.require('goog.events.BrowserFeature');
|
||||
goog.require('goog.userAgent');
|
||||
|
||||
|
||||
/**
|
||||
@@ -324,8 +325,12 @@ Blockly.createSvgElement = function(name, attrs, opt_parent) {
|
||||
* @return {boolean} True if right-click.
|
||||
*/
|
||||
Blockly.isRightButton = function(e) {
|
||||
// Control-clicking in WebKit on Mac OS X fails to change button to 2.
|
||||
return e.button == 2 || e.ctrlKey;
|
||||
if (e.ctrlKey && goog.userAgent.MAC) {
|
||||
// Control-clicking on Mac OS X is treated as a right-click.
|
||||
// WebKit on Mac OS X fails to change button to 2 (but Gecko does).
|
||||
return true;
|
||||
}
|
||||
return e.button == 2;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user