mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Blockly.utils.userAgent moved to Blockly.userAgent
This commit is contained in:
@@ -29,6 +29,7 @@ goog.provide('Blockly.FieldTextInput');
|
||||
goog.require('Blockly.DropDownDiv');
|
||||
goog.require('Blockly.Field');
|
||||
goog.require('Blockly.Msg');
|
||||
goog.require('Blockly.userAgent');
|
||||
goog.require('Blockly.utils');
|
||||
|
||||
goog.require('goog.math.Coordinate');
|
||||
@@ -165,9 +166,9 @@ Blockly.FieldTextInput.prototype.setSpellcheck = function(check) {
|
||||
Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
|
||||
this.workspace_ = this.sourceBlock_.workspace;
|
||||
var quietInput = opt_quietInput || false;
|
||||
if (!quietInput && (Blockly.utils.userAgent.MOBILE ||
|
||||
Blockly.utils.userAgent.ANDROID ||
|
||||
Blockly.utils.userAgent.IPAD)) {
|
||||
if (!quietInput && (Blockly.userAgent.MOBILE ||
|
||||
Blockly.userAgent.ANDROID ||
|
||||
Blockly.userAgent.IPAD)) {
|
||||
this.showPromptEditor_();
|
||||
} else {
|
||||
this.showInlineEditor_(quietInput);
|
||||
@@ -301,7 +302,7 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) {
|
||||
this.setValue(text);
|
||||
Blockly.Events.setGroup(false);
|
||||
this.validate_();
|
||||
} else if (Blockly.utils.userAgent.WEBKIT) {
|
||||
} else if (Blockly.userAgent.WEBKIT) {
|
||||
// Cursor key. Render the source block to show the caret moving.
|
||||
// Chrome only (version 26, OS X).
|
||||
this.sourceBlock_.render();
|
||||
@@ -348,13 +349,13 @@ Blockly.FieldTextInput.prototype.resizeEditor_ = function() {
|
||||
|
||||
// Shift by a few pixels to line up exactly.
|
||||
xy.y += 1;
|
||||
if (Blockly.utils.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
|
||||
if (Blockly.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
|
||||
// Firefox mis-reports the location of the border by a pixel
|
||||
// once the WidgetDiv is moved into position.
|
||||
xy.x -= 1;
|
||||
xy.y -= 1;
|
||||
}
|
||||
if (Blockly.utils.userAgent.WEBKIT) {
|
||||
if (Blockly.userAgent.WEBKIT) {
|
||||
xy.y -= 3;
|
||||
}
|
||||
div.style.left = xy.x + 'px';
|
||||
|
||||
Reference in New Issue
Block a user