Fix nits and remove the hacking of changing html editor element visibility by setting opacity and z-index

This commit is contained in:
Yuan Xulei 2015-01-30 11:14:49 +08:00
Родитель d7c5d21049
Коммит 624bf9663a
3 изменённых файлов: 5 добавлений и 14 удалений

Просмотреть файл

@ -1591,7 +1591,7 @@ var currentlyFocusedTextEditor;
promise = this.textEditor.blur();
currentlyFocusedTextEditor = null;
} else {
promise = Promise.resolve();
return;
}
asyncImpl("V", promise);
};

Просмотреть файл

@ -73,7 +73,7 @@ var TextEditorProvider = (function() {
return new Promise(function(resolve, reject) {
if (currentVisibleEditor !== this ||
document.activeElement === this.textEditorElem) {
resolve()
resolve();
return;
}
setTimeout(this.textEditorElem.focus.bind(this.textEditorElem));
@ -118,15 +118,8 @@ var TextEditorProvider = (function() {
}
if (aVisible) {
// Add the "show" class to set opacity to 0.
// Sometimes in Java, setVisible() is called after focus(), to make
// sure the native input won't lose focus, we change opacity instead
// of visibility.
this.textEditorElem.classList.add("show");
} else {
// Remove the "show" class to set z-index to -999.
// To make sure the j2me control could be clicked again to show the
// textEditor, we need to put the textEditor at the bottom.
this.textEditorElem.classList.remove("show");
}
@ -213,7 +206,7 @@ var TextEditorProvider = (function() {
},
setForegroundColor: function(color) {
this.foregroundColor = color;
this.foregroundColor = color;
this._setStyle("color", util.abgrIntToCSS(color));
},

Просмотреть файл

@ -326,13 +326,11 @@ form[role="dialog"][data-type="confirm"].lcdui-alert section {
position: absolute;
border: none;
resize: none;
opacity: 0;
z-index: -999;
visibility: hidden;
}
.text-editor.show{
opacity: 1;
z-index: 10;
visibility: visible;
}
#textarea-editor {