Keep text-input widget div options to CSS class

This commit is contained in:
Tim Mickel 2016-04-06 21:01:55 -04:00
parent 8af37d7f53
commit 382a1f4f82
2 changed files with 7 additions and 0 deletions

View file

@ -143,6 +143,9 @@ Blockly.Css.CONTENT = [
'display: none;',
'position: absolute;',
'z-index: 999;',
'}',
'.blocklyWidgetDiv.fieldTextInput {',
'overflow: hidden;',
'border: 1px solid;',
'box-sizing: border-box;',

View file

@ -127,6 +127,8 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
Blockly.WidgetDiv.show(this, this.sourceBlock_.RTL, this.widgetDispose_());
var div = Blockly.WidgetDiv.DIV;
// Apply text-input-specific fixed CSS
div.className += ' fieldTextInput';
// Create the input.
var htmlInput = goog.dom.createDom('input', 'blocklyHtmlInput');
htmlInput.setAttribute('spellcheck', this.spellcheck_);
@ -317,6 +319,8 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() {
style.width = 'auto';
style.height = 'auto';
style.fontSize = '';
// Reset class
Blockly.WidgetDiv.DIV.className = 'blocklyWidgetDiv';
};
};